Rails 4中document.ready失效
2016-01-15 16:53
465 查看
Rails 4中turbolinks
turbolinks介绍
这篇文章翻译的不错 http://www.oschina.net/translate/introducing-turbolinks-for-rails-4-0turbolinks使document.ready失效
由于turbolinks机制不会完全刷新页面,导致document.ready方法无法执行。解决办法:
在href或link中加入属性,'data-no-turbolink' => true,会使此次跳转的turbolinks失效,从而使document.ready方法可以执行。
For example:
<%= link_to('Giraffe', @giraffe, data: { no_turbolink: true }) %>
But the following also works:
<%= link_to('Giraffe', @giraffe, 'data-no-turbolink' => true) %>
相关文章推荐
- Paint获取Text的宽和高的数据
- Spark学习之键值对(pair RDD)操作(3)
- Spark学习之键值对(pair RDD)操作(3)
- 使用Genymotion调试出现错误INSTALL_FAILED_CPU_ABI_INCOMPATI
- 全本一六年一月再论人工智能
- ALLOCATE语句分配FORTRAN动态数组方法(转自http://blog.csdn.net/zhuxianjianqi/article/details/8067174)
- vim molokai配色方案(调过)
- grails学习笔记
- hybris trail goal
- clang: error: linker command failed with exit code 1 (use -v to see invocation)
- foxmail设置gmail 不翻墙,切换账户!!!thunderbird
- MT6755 使用R63350 IC 出现唤醒概率性闪白,并导致ESD FAIL
- CES2016:IBM使用Watson AI展示了健康应用和机器人
- [DGMGRL]ORA错误解决(ORA-16829: fast-start failover configuration is lagging)
- 行为树-学习笔记(5)-AI寻找玩家目标并攻击的实现
- 放弃iPad Pro并换回iPad Air 2 你是这样吗?
- Plain Old Data (POD)
- codeforces 616E - Sum of Remainders
- POJ1422 Air Raid 【DAG最小路径覆盖】
- HDU 1104 Remainder