[英]Javascript not running on Heroku, dev fine, others fine
I have a Rails 3.1 app with several Javascripts that run just fine on Heroku. 我有一个带有几种Javascript的Rails 3.1应用程序,它们可以在Heroku上很好地运行。 I wanted to auto detect time zones and started working with this Jon Nylanders awesome script to do that.
我想自动检测时区,并开始使用这个Jon Nylanders出色的脚本来做到这一点。 It's available here: https://bitbucket.org/pellepim/jstimezonedetect/src
可以在这里找到: https : //bitbucket.org/pellepim/jstimezonedetect/src
Now the problem is, this Javascript runs just fine on my local machine but not on Heroku. 现在的问题是,此Javascript在我的本地计算机上运行得很好,但在Heroku上却没有。 The console in Safari says the function is undefined.
Safari中的控制台说该功能未定义。 I call it like this:
我这样称呼它:
<script type="text/javascript">
var tz = jstz.determine();
</script>
The main difference between this Javascript and the others I use is that this one has a name space. 此Javascript与我使用的其他Javascript之间的主要区别在于,该Javascript具有名称空间。 Maybe that has something to do with it?
也许与它有关?
I have run rake and I have verified that application.js contains the script. 我已经运行rake,并且已经验证了application.js包含脚本。 I have tried the downloadable minified version as well as the full source in it's own .js file.
我尝试了可下载的缩小版本以及其自己的.js文件中的完整源代码。
It turns out there was an error in another Javascript, an error that I disregarded for the time being (as I didn't use that code anyway). 事实证明,另一个Javascript中有一个错误,我暂时不理会这个错误(因为无论如何我都没有使用该代码)。 When compiled into application.js however, this error somehow disturbed the execution of all the other javascripts too.
但是,当编译为application.js时,此错误也会以某种方式干扰所有其他javascript的执行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.