Click here to Skip to main content
15,889,595 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi,
I have Web UI and I am reading value from file and displaying it on screen after some time interval thru javascript. Values are updaing properly in chrome but not in IE 8.0. Please suggest me what can be done for this?
Regds
SNI

PFB the code snippet
var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
setInterval(loadFile,2000);

function loadFile()
{
var data = "";

xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
var myval =function(xmlhttp.responseText,"MYVAL");
if(myval <0){
document.getElementById("rtHeader_val").src="images/LTE/1.png";
}
document.getElementById("myval_1").innerHTML=myFunction(xmlhttp.responseText,"MYVAL");


if(xmlhttp)
{
//myinfo is input file from which application reads the values
xmlhttp.open("GET","/config/myinfo",false);
xmlhttp.send();
data=xmlhttp.responseText;
}

}
This code updates value after 2 secs on chrome but not IE 8
Posted
Updated 16-Oct-13 22:15pm
v2
Comments
bjdestiny 16-Oct-13 9:32am    
can you specify the code?
SNI 16-Oct-13 12:54pm    
In javascript I have set an interval of 5secs. every 5 secs script executes and reads the file using XmlHttpRequest object and parsing the xml response. this code works well in google chrome but in IE 8.0 I need to launch a browser again to see the changed values in file. This file is get updated by other process.
Sergey Alexandrovich Kryukov 16-Oct-13 14:26pm    
Please see the comment above. It meant to say: you need to provide a relevant code sample. At this moment, I cannot see a reason why IE8 did not work for you.
After 60 questions in this forum, I think you should get a feeling what's needed to get successful advice.
By also, it looks like you rather should review your design.
—SA
SNI 17-Oct-13 3:04am    
var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
setInterval(loadFile,2000);

function loadFile()
{
var data = "";

xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
var myval =function(xmlhttp.responseText,"MYVAL");
if(myval <0){
document.getElementById("rtHeader_val").src="images/LTE/1.png";
}
document.getElementById("myval_1").innerHTML=myFunction(xmlhttp.responseText,"MYVAL");


if(xmlhttp)
{
//myinfo is input file from which application reads the values
xmlhttp.open("GET","/config/myinfo",false);
xmlhttp.send();
data=xmlhttp.responseText;
}

}
This code updates value after 2 secs on chrome but not IE 8
Sergey Alexandrovich Kryukov 17-Oct-13 3:08am    
Oh... Better use "Improve question", format properly...
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900