简体   繁体   English

JavaScript在开发中发挥作用,而不在生产中发挥作用(Heroku)

[英]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.

相关问题 javascript .get 函数在开发中有效,但在生产中无效 - javascript .get function works in development but not production jQuery在Production&Heroku中不起作用,但在开发中效果很好 - Jquery not working in Production & Heroku but works perfectly well in development Sails JS-显示Flash消息不适用于Heroku(生产),但在开发中效果很好 - Sails JS - Display flash message doesn't work on Heroku(production) but works fine in development JavaScript开发和生产模式 - JavaScript development and production mode Javascript“开发”和“生产 - Javascript “development” and "production Javascript requirejs正在开发中,但在生产中编译 - Javascript requirejs in development but compiled in production javascript代码部分未在测试环境中执行,可在生产,开发中使用(Rails 3应用) - javascript code partially not executed in test environment, works in production, development (Rails 3 app) Rails 4 - 在生产中,我的 javascript 已加载,但在开发中运行良好时不起作用 - Rails 4 - In production my javascript is loaded but does not work while it works well in development JavaScript无法在本地和Heroku上进行生产 - JavaScript not working on Production locally and heroku React NPM 包(Dragula)可用于开发但不能用于生产 - React NPM package(Dragula) works in development but not in production
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM