Jump to content

AJAX page via IE requires F5 on load


codecomm

Recommended Posts

I have an html page with a FLASH header.

 

If I open the web page w/in IE, then I have to hit F5.

 

If I open the web page w/in FireFox, then it opens fine and I get my data table build via my AJAX call:

 

<script type="text/javascript">

function ajaxFunction(qry){

var xmlHttp;

try{

xmlHttp=new XMLHttpRequest();

}

catch(e){

try{

xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");

}

catch(e){

try{

xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");

}

catch(e){

alert("Your browser does not support AJAX!");

return false;

}

}

}

 

xmlHttp.onreadystatechange=function(){

if(xmlHttp.readyState==4){

document.getElementById("contentAJAX").style.background = "#FFF";

document.getElementById("contentAJAX").style.border = "none";

document.getElementById("contentAJAX").style.padding = "0";

document.getElementById("contentAJAX").innerHTML=xmlHttp.responseText;

}

}

 

document.getElementById("contentAJAX").style.background = "#DDD";

document.getElementById("contentAJAX").style.border = "1px solid #333";

document.getElementById("contentAJAX").style.padding = "50px 0";

document.getElementById("contentAJAX").innerHTML="<b>Loading...</b><br><br><img src='ajax-loader.gif' />";

 

xmlHttp.open("GET","proxy.asp?qry="+qry,true);

xmlHttp.send(null);

//alert("Sent");

}

Link to comment
https://forums.phpfreaks.com/topic/100193-ajax-page-via-ie-requires-f5-on-load/
Share on other sites

You need to append a random number as an addition get parameter on the end of your url (it will be unused in your script), so that each http request looks like a unique request so that the browser will actually make the request to the server.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.