即保存onunload错误 [英] ie save onunload bug

查看:73
本文介绍了即保存onunload错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个动态的ajaxy应用程序,当用户关闭浏览器窗口时,我保存了状态. 在所有浏览器中都可以正常运行,但是在IE中存在问题.关闭两次应用程序选项卡后,我无法再连接到服务器.

I have a dynamic ajaxy app, and I save the state when the user closes the explorer window. It works ok in all browsers but in IE there is problem. After I close twice the application tab, i can't connect anymore to the server.

我的理论是,在关闭选项卡时,与服务器的连接无法完成,因此ie7认为它与服务器有2个未完成的连接,因此会无限期地排队新的连接.

My theory is that the connection to the server fail to complete while the tab is being closed and somehow ie7 thinks that it has 2 outstanding connections to the server and therefore queues new connections indefinitely.

任何人都经历过这种情况,任何解决方法或解决方案吗?

Any one has experienced this, any workaround or solution?

推荐答案

在IE中,如果您使用长轮询AJAX请求,则必须在卸载"时关闭XHR连接.否则,即使您离开站点导航,它也会被浏览器保持活动状态.这些保持活动的连接将导致挂起,因为您的浏览器将达到最大打开连接限制.

In IE if you use long-polling AJAX request, you have to close down the XHR connection on 'unload'. Otherwise it will be kept alive by browser, even if you navigate away from your site. These kept alive connections will then cause the hang, because your browser will hit the maximum open connection limit.

在其他浏览器中不会发生此问题.

This problem does not happen in other browsers.

这篇关于即保存onunload错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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