nadeemshafi9 Posted July 31, 2008 Share Posted July 31, 2008 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 https://forums.phpfreaks.com/topic/117504-set-timout-not-working-properly-in-ie6-and-7/ Share on other sites More sharing options...
rhodesa Posted July 31, 2008 Share Posted July 31, 2008 can you post some code or provide a link to an example? Link to comment https://forums.phpfreaks.com/topic/117504-set-timout-not-working-properly-in-ie6-and-7/#findComment-604515 Share on other sites More sharing options...
nadeemshafi9 Posted August 4, 2008 Author Share Posted August 4, 2008 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 https://forums.phpfreaks.com/topic/117504-set-timout-not-working-properly-in-ie6-and-7/#findComment-607401 Share on other sites More sharing options...
rhodesa Posted August 11, 2008 Share Posted August 11, 2008 yeah, i usually use method #2 also....but that doesn't seem to relate to the original problem. is this topic resolved? Link to comment https://forums.phpfreaks.com/topic/117504-set-timout-not-working-properly-in-ie6-and-7/#findComment-613506 Share on other sites More sharing options...
corbin Posted August 11, 2008 Share Posted August 11, 2008 Don't reuse the same AJAX object in IE. To put it simply, it doesn't work. Link to comment https://forums.phpfreaks.com/topic/117504-set-timout-not-working-properly-in-ie6-and-7/#findComment-613689 Share on other sites More sharing options...
nadeemshafi9 Posted August 20, 2008 Author Share Posted August 20, 2008 i attatched the date/time in JAVASCRIPT to the url being repeatedly called it worked Link to comment https://forums.phpfreaks.com/topic/117504-set-timout-not-working-properly-in-ie6-and-7/#findComment-621475 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.