如何防止 webkit 不断加载 url / throbber of doom
对此有一些问题,但大多缺乏细节,也没有明确的答案。
所以我使用 xhr 长轮询,我的轮询非常基本,看起来就像
var poll = function() {
$.get(url, function(data) {
doStuff(data);
poll();
});
};
我从之前导入的脚本开始,我删除了页面上的所有其他内容,所以唯一在 javascript 中加载的东西(同步),然后我将调用包装起来,
window.onload = function () {
setTimeout(poll, 0);
};
但是 webkit 仍然给我一个不断加载的 url 栏,我可以将 0 更改为任意数字来修复它,但是我真的希望有一种一致的方法,再也不会看到这个问题。
有人有什么想法吗?我尝试了各种其他技术来等待加载,检查 Web 检查器显示包含运行上述 js 的文件是轮询开始之前加载的最后一件事,该文件的最后一行是 })();执行整个事情。
There is a few questions about this, but mostly lacking details and no definitive answer.
So I am using xhr long polling, my poll is pretty basic and just looks like
var poll = function() {
$.get(url, function(data) {
doStuff(data);
poll();
});
};
I start that from a script that is imported just before , I remove absolutely everything else on the page so the only thing that is loaded in javascript (synchronously), I then wrap the call in
window.onload = function () {
setTimeout(poll, 0);
};
However webkit still gives me a constantly loading url bar, I can change 0 to some arbitrary number to fix it, however I would really like a consistent way to never see this issue again.
Anyone have any ideas? I have tried various other techniques to wait for loading, checking in web inspector shows the file that contains runs the above js is the last thing to load before the poll starts, and the last line of that file is the })(); that executes the whole thing.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论