views:

335

answers:

2

Hello everyone,

in my application i am using xmlhttp, which is called by a function after a time interval say 3 second.

The problem is that everything is going well in Chrome and Mozila firefox but in Ie8, some times it works ans sometime its not, and when it worked in I8 (sometime) then it takes long time rather than i set the interval, and need that the response will be correct, so now i am confusing that, is ie8 cache the xmlhttp and the same result is shown from its cache so something else.

and ya i did one thing to do this i place a anchor button on the page and in click event of this anchor i called that function. when i clicked it, its working properly.

so please help me if there is something special in ie8 regarding XMLHTTP.

A: 

Hi,

Try sending a random hash as parameter in the url, so each request gets "different" to the browser .. also, if possible, print some headers in the file your calling with metatags to prevent caching, like this (in case it's php) :

header( "Expires: Mon, 20 Dec 1998 01:00:00 GMT" );
header( "Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT" );
header( "Cache-Control: no-cache, must-revalidate" );
header( "Pragma: no-cache" );
yoda
A: 

Ensure the fully qualified name of the web page is the same as the remote AJAX URL you are loaing from.

I think IE does extra security to stop cross site scripting hacks, by ensuring that the XMLHTTPRequest connection doesn't try to connect to a site that isn't the same as your web page name.

I'm no sure what you are doing with the XMLHTTP object, but that may help.