0 Replies - 176 Views - Last Post: 17 October 2013 - 05:41 PM

#1 Shzylo  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 29-September 13

How to update a webpage when user first visits (not dynamic updating)

Posted 17 October 2013 - 05:41 PM

I have a problem with my webpage, I want to have the webpage update when the user visits it. I tried using this code:

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

Is This A Good Question/Topic? 0
  • +

Page 1 of 1