function requestData(var page) { var xmlhttp; if ( window.XMLHttpRequest ) { // IE7+, Chrome, FireFox, Safari, Opera xmlhttp = new XMLHttpRequest(); } else { // IE5, IE6 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.readystatechange=function() { if(xmlhttp.readyState == 4 && xmlhttp.status == 200) { document.body.innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET", page, true); xmlhttp.send(); }
, but it didn't do what I needed it to do. When a user visits a web page, I want the information to update without the user having to refresh, but how would I accomplish this, that isn't dynamic updating (updating while the user is on the page)?