Question

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?

Was it helpful?

Solution

You should implement support for JSONP in your API.

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top