javascript - Ajax call is not working in Internet Explorer9 and Internet Explorer10 -
i used function display item page using ajax. working fine on chrome.but not in internet explorer.
<script type="text/javascript"> function grabinfo(str) { if (str=="") { document.getelementbyid("contentdiv").innerhtml=""; return; } if (window.xmlhttprequest) { // code ie7+, firefox, chrome, opera, safari xmlhttp=new xmlhttprequest(); } else { // code ie6, ie5 xmlhttp=new activexobject("microsoft.xmlhttp"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readystate==4 && xmlhttp.status==200) { document.getelementbyid("contentdiv").innerhtml=xmlhttp.responsetext; } } xmlhttp.open("get","get_property.php?q="+str,true); xmlhttp.send(); } </script>
this function returning updated results on chrome.but in internet explorer, function returns previous results.if clear sessions using ctrl+shift+del, system shows updated results.why happening? can on this?
thanks in advance....
internet explorer caches responses. can either add random value request url's query string using math.random()
or include response header in server-side script.
cache-control: no-cache, no-store
Comments
Post a Comment