简体   繁体   中英

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. I wanted to auto detect time zones and started working with this Jon Nylanders awesome script to do that. It's available here: https://bitbucket.org/pellepim/jstimezonedetect/src

Now the problem is, this Javascript runs just fine on my local machine but not on Heroku. The console in Safari says the function is undefined. 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. Maybe that has something to do with it?

I have run rake and I have verified that application.js contains the script. I have tried the downloadable minified version as well as the full source in it's own .js file.

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). When compiled into application.js however, this error somehow disturbed the execution of all the other javascripts too.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM