Frage

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?

War es hilfreich?

Lösung

You should implement support for JSONP in your API.

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

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top