$(document).on'ready page:load'-在ie10中无法正常工作 [英] $(document).on 'ready page:load' - not working in ie10 correctly

查看:171
本文介绍了$(document).on'ready page:load'-在ie10中无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在发展.对于jQuery,我使用coffeescript. Turbolink处于活动状态.

i am developing in rails. for jquery i use coffeescript. turbolinks are active.

我遇到了一个问题,这让我感到不安.

i have an issue and it gets me on my nerves.

当我想启动我的功能(这里称为脚本)时,我使用以下代码:

when i want to start my function (here called scripts) i use the following code:

$(document).on 'ready page:load', =>
    scripts()

我的脚本(div滑块)在加载页面时正在运行,在所有浏览器中都没有任何问题.

my script (div slider) is running when page is loaded, without any problems in all browsers.

无论如何,当我单击另一页然后重新开始时,javascript没有加载.这个问题实际上仅在ie10中.

anyway, when i click on another page and then get back to the start, the javascript is not loading. this issue is actually only in ie10.

我已经尝试了以下方法:

i tried the following already:

$(document).on 'ready page:change', =>
    scripts()

..但div滑块失去控制.它跳不理性. ;-)

.. but then the div slider gets out of control. it jumps nonrational. ;-)

我该怎么办?有什么想法吗?

what can i do? any ideas?

谢谢!

st

推荐答案

您可以尝试

$(document).on 'ready, page:change', =>
    scripts()

在ready和page:change之间添加逗号,以分隔两个参数.

add a comma between ready and page:change, to separate both parameters.

这篇关于$(document).on'ready page:load'-在ie10中无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆