我该如何解决Chrome的XMLHttpRequest侵入式“加载”问题?行为?
这是谷歌无法回答的问题。 我正在使用 XMLHttpRequest 对多人游戏进行一些 HTTP“长轮询”。 在 Chrome 中,这会导致选项卡始终处于“正在加载”状态: (1)选项卡中的图标不断播放loading动画 (2) 光标始终呈沙漏状 (3) 状态永远保留在视图区域的底部,显示“正在联系本地主机”
我确信其他人也遇到过这种情况,但我还找不到他们。
Here's a problem Google can't answer.
I'm doing some HTTP "long polling" with XMLHttpRequest for a multiplayer game.
In Chrome, this causes the tab to always be "loading" :
(1) the icon in the tab is constantly playing the loading animation
(2) the cursor is constantly an hourglass
(3) the status persists forever at the bottom of the view area saying "contacting localhost"
I was sure others have run into this, but I can't find them yet.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试在页面加载后稍微启动第一个长轮询,而不是直接在页面加载事件中启动(使用页面加载时触发的短超时)。看来你需要给 Chrome 几毫秒的时间来恢复平静,这样它就不会一直看起来像是在加载。
Try starting the first long poll slightly after the page loads, rather than directly in the page load event (use a short timeout triggered on page load). It seems like you need to give Chrome a few milliseconds to regain it's composure so it doesn't constantly look like it's loading.