开发者

Cleaning up the jQuery in rails

I have a rails application and I have all the jQuery scattered out in alot of different views and this is really ugly.I really want the jQuery in one place but when i take开发者_StackOverflow中文版 some of the jQuery code and move it to the application.js file the jQuery doesnt work or is maybe included last....I really dont know the issue. Can i have some help on the right way to do this ........


A few points:

  1. Ensure you include you 'application.js' file last in your layouts files
  2. If the functions require the DOM to load, use '$(document).ready'
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜