In a project I'm developing, I need to update some fields on the page every 50ms
(this is adjustable). The problem is that when I test in IE, the fields are no longer updated from time to time, with no explanation whatsoever. Usually it works for a few seconds and stops.
I have already verified the following: the (IE) debugger does not acknowledge anything, it works smoothly in Chrome and Firefox, and (xmlhttp.readyState == 4 && xmlhttp.status == 200)
conditions are satisfied, setInterval()
is working. The page only resumes on the F5 basis.
The code I use to update the fields is as follows:
var adc_array = [0, 0, 0, 0, 0, 0, 0];
function update_adc()
{
var xmlhttp;
if (window.XMLHttpRequest)
{
xmlhttp = new XMLHttpRequest();
}
else
{
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange = function()
{
if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
{
adc_array = xmlhttp.responseText.split(" ");
for (var i = 0; i < adc_array.length; i++)
{
if(adc_array[i])
{
document.getElementById("adc" + i).innerHTML = adc_array[i] + " V";
}
}
}
}
xmlhttp.open("GET", "./rtu:analogic_inputs", true);
xmlhttp.send();
}
Apparently it's like div's
has failed, but that's not happening (I can access manually, and it works in other browsers).