开发者

How to prevent webkits constant url loading url / throbber of doom

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 thi开发者_如何学Gong 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜