Question

w=new Worker("../reloading.js?"+queries);//called to reload(refreshing) with new xml data and queries having request xml and refreshing seconds and called refresh javascript is

var serverURL = "/Test";
var UrlToCall = serverURL+""+location.search;//am  using sessions
var sec = gup("autoRefreshSec");//setting auto refreshing time
function sendToServer()
{
var xmlhttp=new XMLHttpRequest();   
xmlhttp.onreadystatechange=function(){
      if (xmlhttp.readyState==4 && xmlhttp.status==200)
        {
            postMessage(xmlhttp.responseText);
        }
      }
xmlhttp.open("GET",UrlToCall,true);
xmlhttp.send();
setTimeout("sendToServer()",(sec*1000));
}
sendToServer();
function gup( name ) {
    name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
    var regexS = "[\\?&]"+name+"=([^&#]*)";
    var regex = new RegExp( regexS );
    var results = regex.exec( location.search );
    if( results == null )
        return "";
    else
        return results[1];
}

this is refreshing javascript file,default autorefresh body as 10seconds. its did not working on IE browser(when refreshing of body content only), its working in FireFox and Chrome. i did not find any request on server console(but in FireFox i get requests and response in server console). need to change anything in code.

Was it helpful?

Solution

  • try this one

xmlhttp.setRequestHeader("Cache-Control", "no-cache"); xmlhttp.setRequestHeader("Pragma", "no-cache"); xmlhttp.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top