$(document).ready()在使用window.location重定向后未触发 [英] $(document).ready() not firing after redirect with window.location

查看:165
本文介绍了$(document).ready()在使用window.location重定向后未触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经阅读了其他问题

jQuery $(document).ready()不触发在window.location.href之后

jQuery $(document).ready()未触发

为什么$(document).ready not fire for我吗?

然而,所有解决方案似乎都不起作用...

yet none of the solutions seem to work...

我的问题是jQuery $(document).ready()在Firefox中没有触发,但在重定向后在其他浏览器中却触发了.我知道js会被加载,因为它的末尾附加了一个时间变量,以防止其缓存.

My issue is that the jQuery $(document).ready() is not firing in Firefox yet fires in other browsers after the redirect. I know the js gets loaded since it has a time variable appended to the end to keep it from caching.

我尝试使用$(window).load()获得相同的结果. Firebug没有显示错误,并且正在显示正在加载的脚本,但是在ready()函数上放置的断点永远不会触发.

I have tried using $(window).load() to the same result. Firebug is not showing errors and is showing the script being loaded, however a breakpoint placed on the ready() function never triggers.

Firefox中是否存在某种可能导致此问题的安全限制,如果是的话,我将如何解决这些问题?

Are there some sort of security restrictions in Firefox that could be causing the issue and if so how would I get around them?

推荐答案

直到我能找到更好的选择,<body onUnload="">在FF5中对我有效.我认为您的问题可能超出此修复范围?

Until I can find a better alternative, <body onUnload=""> works for me in FF5. I think your problem might go a little beyond this fix?

这篇关于$(document).ready()在使用window.location重定向后未触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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