【问题标题】:Generate JavaScript using the Grape API?使用 Grape API 生成 JavaScript?
【发布时间】:2013-12-10 23:58:18
【问题描述】:

我正在使用 Grape 框架来检索数据,效果很好。我还想使用 API 检索 JavaScript 文件。例如:

<!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 正在调用 API。

最好的方法是什么?

【问题讨论】:

    标签: ruby grape grape-api


    【解决方案1】:

    您应该在您的 API 中实现对 JSONP 的支持。

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-05-08
      • 2012-08-16
      • 2013-05-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多