[英]JavaScript Works in Development, Not in Production (Heroku)
So I just pushed an app to Heroku, and JavaScript and jQuery are not working for me. 所以我只是将一个应用程序推到了Heroku,JavaScript和jQuery对我不起作用。
Have looked at a bunch of solutions for this but none seem to be work. 已经查看了很多解决方案,但似乎没有一个可行。
I have precompiled my assets, and I can see in Firebug that some of the functions I have declared in some of my js files in the assets folder are loading but some are not. 我已经预编译了我的资产,并且在Firebug中可以看到我在资产文件夹中的某些js文件中声明的某些功能正在加载,而有些则没有。
Edit: Just added a very simple alert function which works just fine. 编辑:刚刚添加了一个非常简单的警报功能,效果很好。
Images are loading fine, styles are loading fine. 图像加载良好,样式加载良好。 Have rails_12factor gem and have run bundle exec rake assets:precompile.
具有rails_12factor gem并运行捆绑包exec rake asset:precompile。 Can anyone point me in the right direction in terms of debugging?
任何人都可以在调试方面为我指明正确的方向吗?
So, I was getting this error; 所以,我得到了这个错误;
'undefined' is not an object (evaluating 'f.msie') “未定义”不是对象(评估“ f.msie”)
which was resulting from one of the plugins using $.browser which has since been removed. 这是由于其中一个使用$ .browser的插件导致的,此插件已被删除。
Installed jQuery migrate gem, re-pushed code, all jQuery and javascript now works. 已安装jQuery迁移gem,重新推送了代码,所有jQuery和javascript现在都可以使用。
Thanks to anyone who took the time to look this over. 感谢所有花时间查看此内容的人。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.