0

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?

Ashish Chopra
  • 1,413
  • 9
  • 23
rstewart8
  • 89
  • 1
  • 10

1 Answers1

1

You should implement support for JSONP in your API.

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

NARKOZ
  • 27,203
  • 7
  • 68
  • 90