문제

I am using the Grape framework to retrieve data, which is working great. I would also like to retrieve a JavaScript file using the API. For example:

<!DOCTYPE html>
<html>
    <head>
        <script defer src="http://someapi.com/dni_js/dni.js" > </script>
    </head>
    <body>
    </body>
</html>

http://someapi.com/dni_js/dni.js is calling the API.

What would be the best way to accomplish this?

도움이 되었습니까?

해결책

You should implement support for JSONP in your API.

https://github.com/intridea/grape#jsonp

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top