shadiadiph Posted April 21, 2010 Share Posted April 21, 2010 Hi sorry i am still completely clueless about ajax I have been trying to use the following to refresh a php page i am including but it will not work any tips would be most appreciated, keeps giving me the error the data necessary to complete this operation is not yet available??? <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(){ document.getElementById('usersonline').innerHTML=xmlHttp.responseText; setTimeout('Ajax()',"20000"); } xmlHttp.open("GET","online.php",true); xmlHttp.send(null); } window.onload=function(){ setTimeout('Ajax()',"20000"); } </script> </head> <body> <div id="wrapper"> <div id="headertop"> <div id="usersonline"><? include_once("online.php"); ?></div> </div> Link to comment https://forums.phpfreaks.com/topic/199233-refreshing-a-div-with-a-php-page-included-error/ Share on other sites More sharing options...
shadiadiph Posted April 21, 2010 Author Share Posted April 21, 2010 no problem i solved it Link to comment https://forums.phpfreaks.com/topic/199233-refreshing-a-div-with-a-php-page-included-error/#findComment-1045635 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.