phpmady Posted March 16, 2011 Share Posted March 16, 2011 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script type="text/javascript"> function Ajax(){ var xmlHttp; try{ xmlHttp=new XMLHttpRequest();// Firefox, Opera 8.0+, Safari } catch (e){ try{ xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); // Internet Explorer } catch (e){ try{ xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ alert("No AJAX!?"); return false; } } } xmlHttp.onreadystatechange=function(){ if(xmlHttp.readyState==4){ document.getElementById('content').innerHTML=xmlHttp.responseText; setTimeout('Ajax()',1000); } } xmlHttp.open("GET","data.php",true); xmlHttp.send(null); } window.onload=function(){ setTimeout('Ajax()',1000); } </script> </head> <body> <div id="content"> <?php echo " test the content div"; ?> </div> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/230783-why-my-div-content-is-not-refreshing-by-ajax-in-ie/ Share on other sites More sharing options...
Adam Posted March 16, 2011 Share Posted March 16, 2011 Can you provide more information please. What is happening? What isn't happening? What syntax errors are you getting? Quote Link to comment https://forums.phpfreaks.com/topic/230783-why-my-div-content-is-not-refreshing-by-ajax-in-ie/#findComment-1188127 Share on other sites More sharing options...
phpmady Posted March 16, 2011 Author Share Posted March 16, 2011 Hi friend, actually I have 10 records in the table, i am trying to access all those 10 records to show, but in IE8, i am not getting all the 10 records, Its good in FF and Chrome... In Recent searches i came to know that, i have a memory leak problem with ie. Thanks my friend, if you can , please give me some solution. Thanks a lot Quote Link to comment https://forums.phpfreaks.com/topic/230783-why-my-div-content-is-not-refreshing-by-ajax-in-ie/#findComment-1188153 Share on other sites More sharing options...
woolyg Posted March 18, 2011 Share Posted March 18, 2011 Hi phpmady, You use the word "refresh", which could indicate that you need to use setInterval rather than setTimeout? Please see http://www.phpfreaks.com/forums/index.php?topic=327711.0, which I managed to work out for my own regularly-updating div issue... If you add a unique identifier in the URI of the data.php call (like a current timestamp, generated by javascript , something like that) then the recurring call will not be cached as it has a unique value in the URI being called. Just a thought. WoolyG Quote Link to comment https://forums.phpfreaks.com/topic/230783-why-my-div-content-is-not-refreshing-by-ajax-in-ie/#findComment-1189323 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.