简体   繁体   中英

Included jQuery not works under production mode raise `is not a function` error

I put the jquery.placeholder.js under assets/javascripts folder

then apply the function in my coffeescript file and works fine.

$(document).ready ->
  $('input, textarea').placeholder();

However, When I run in production mode by RAILS_ENV=production rails s

Raise not a function error on Firebug console 在此处输入图片说明

I put other related files on gist

https://gist.github.com/poc7667/7576566

取消注释行:config / enviroments / production.rb中为50,并在其中添加jquery.placeholder.js以对其进行预编译

config.assets.precompile += %w( jquery.placeholder.js )

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