在 Rails 3 (Sprocket) 中,有没有办法使用远程站点的 url 加载 javascript 文件?例如,我希望在您的 .js 文件中使用类似的内容require指示,
//= require http://example.com/remote_file.js
No.
您只能请求应用程序内部或应用程序所依赖的 gem 中的文件。看http://guides.rubyonrails.org/asset_pipeline.html#asset-organization http://guides.rubyonrails.org/asset_pipeline.html#asset-organization and http://guides.rubyonrails.org/asset_pipeline.html#adding-assets-to-your-gems http://guides.rubyonrails.org/asset_pipeline.html#adding-assets-to-your-gems.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)