Jump to content

set timout not working properly in IE6 and 7


nadeemshafi9

Recommended Posts

hi guys i got my create httprequest object and execute settimout function to update live data, AFTER BODY or in the body onload because i know IE cant handle calls to non loaded tags.

 

for some reason settimout works perfectly in Firefox but not in IE

 

any ideass

 

I first tried the following (which should disable browser caching):

 

(in PHP)

 

header( “Expires: Mon, 26 Jul 1997 05: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” );

 

The data still did not change.

 

I finally came to the following solutions:

 

1) use a POST request. When using with xmlhttprequest, it is slightly more complicated.

 

2) add a unique identifier to the end of my GET url.

 

I choose #2. A unique Identifier can be created using the current data+time. Here is a simple way to generate this (in Javascript):

 

var date = new Date();

var timestamp = date.getTime();

 

createXMLHttpRequest();

xmlHttp.onreadystatechange = handleMessages;

xmlHttp.open(”GET”,”script.php?time=”+timestamp,true);

xmlHttp.send(null);

  • 2 weeks later...

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.