java - How to let XMLHttpRequest not cach in IE -


if(xmlhttp) {  xmlhttp.open("get","dokterweek_klantoverzichtservletajax?" +   $(this).prop("href").split("?")[1],true);//gettime servlet name xmlhttp.onreadystatechange  = handleserverresponse; xmlhttp.setrequestheader('content-type', 'application/x-www-form-urlencoded'); xmlhttp.send(null);  }  }); });    function getxmlobject()  //xml object { var xmlhttp = false; try {  xmlhttp = new activexobject("msxml2.xmlhttp")  // old microsoft browsers   }   catch (e) {    try {    xmlhttp = new activexobject("microsoft.xmlhttp")  // microsoft ie 6.0+    }    catch (e2) {      xmlhttp = false   // no browser accepts xmlhttp object false      }      }    if (!xmlhttp && typeof xmlhttprequest != 'undefined') {     xmlhttp = new xmlhttprequest();        //for mozilla, opera,chrome browsers    }     return xmlhttp;  // mandatory statement returning ajax object created    }        var xmlhttp = new getxmlobject(); //xmlhttp holds ajax object        function handleserverresponse() {     document.getelementbyid("pop1").innerhtml = xmlhttp.responsetext; //update html              form element     } 

hello, have following problem (the code works), xmlhttprequest(ajax-call) refreches when use firefox or chrome (so works nice). ie 9.0+ caches xmlhttprequest, never refreches. read alot problem on internet,but cannot find solution problem.

can tell me possibilities fix this? think fixable using jquery ajax, don't have brains tune whole script jquery. can set live-time 0 don't find this. (i communicate ajax servlet) knows clear,easier solution?

thank much

once of accepted practice add random parameter url timestamp.

add parameter _d url value new date().gettime()

ex:

xmlhttp.open("get","dokterweek_klantoverzichtservletajax?_d=" + (new date().gettime()) + '&' +   $(this).prop("href").split("?")[1], true);//gettime servlet name 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -