簡體   English   中英

包含的jQuery在生產模式下不起作用引發`not a function`錯誤

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

我將jquery.placeholder.js放在assets/javascripts文件夾下

然后在我的coffeescript文件中應用該功能,即可正常工作。

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

但是,當我通過RAILS_ENV=production rails s在生產模式下運行時

在Firebug控制台上引發not a function error 在此處輸入圖片說明

我把其他相關文件放在要點上

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

取消注釋行:config / enviroments / production.rb中為50,並在其中添加jquery.placeholder.js以對其進行預編譯

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM