解决 Rails4.xjs中没法使用$(document).ready()问题

多是由于rails4.x引用 turbolinks   gem缘由吧,每一个页面使用javascript应用,为了响应更快的速度
javascript

解决方法在document中标注'page:load'java


var ready = function() {git

$(document).ready(ready);github

$(document).on('page:load', ready);ip

相关文章
相关标签/搜索