我正在编写一个使用Comet/Long Polling来保持网页最新的AJAX网络应用程序,我注意到在Chrome中,它会将页面视为始终加载(标签图标不断旋转).
我认为这对谷歌Chrome + Ajax来说是正常的,因为即使Google Wave也有这种行为.
那么今天我注意到Google Wave不再保持加载图标旋转,任何人都知道他们如何解决这个问题?
这是我的ajax调用代码
var xmlHttpReq = false;
// Mozilla/Safari
if (window.XMLHttpRequest) {
xmlHttpReq = new XMLHttpRequest();
}
// IE
else if (window.ActiveXObject) {
xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlHttpReq.open('GET', myURL, true);
xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xmlHttpReq.onreadystatechange = function() {
if (xmlHttpReq.readyState == 4) {
updatePage(xmlHttpReq.responseText);
}
}
xmlHttpReq.send(null);
Run Code Online (Sandbox Code Playgroud)