I'm currently developing a web app using AJAX with Comet/Long Polling to ensure real-time updates on the web page. I've noticed that in Chrome, the page is constantly loading (tab icon keeps spinning).
Initially, I thought this was a normal behavior for Google Chrome when working with Ajax, as even Google Wave exhibited the same behavior.
However, today I observed that Google Wave no longer shows the spinning loading icon. Does anyone know how they managed to fix this issue?
Below is the code snippet for my AJAX call:
var xmlHttpReq = false;
// For Mozilla/Safari
if (window.XMLHttpRequest) {
xmlHttpReq = new XMLHttpRequest();
}
// For Internet Explorer
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);