My web application utilizes polling to constantly update the status of a music player. To achieve this, I have implemented a method using setInterval
to execute an Ajax call every half second. This setup functions as intended on a variety of browsers including Chrome, Firefox, and Safari, however, it encounters issues specifically on the Nook Color's browser. Upon initial page load, the correct information is displayed, but subsequent updates consistently display the same information. This behavior was verified through the use of an alert
. Below is the original code snippet:
function getStatus() {
request = new XMLHttpRequest();
request.open("GET", SOME_URL, true);
request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
request.onreadystatechange = function () {
if (request.readyState === 4 && request.status === 200)
updateStatus(request.responseText);
};
request.send()
}
setInterval(getStatus, 500);
Any insights on why the information always remains the same after the initial fetch?
Furthermore, it should be noted that the most recent data is only displayed upon clearing the cache. Interestingly, when the Nook device is rooted and Firefox is installed, the issue disappears. The problem seems to be specific to the Nook's native browser, regardless of whether it is rooted or not.