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

 

Link to comment
Share on other sites

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);

Link to comment
Share on other sites

  • 2 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.