Category:WebHosting

Found 7 records. At Page 2 / 2.

XMLHTTP Ajax非同步更新資料

-
發布於

最近一直瘋狂寫聊天室,更新一堆有的沒的,發個小筆記。

var http = new XMLHttpRequest("Microsoft.XMLHTTP");
var url_='http://example.com/';

function connect(){
	http.onreadystatechange = function(){
		if (http.readyState==4){
			if (http.status==200){
				//Do Something.
			}else{
				//Connect Failed.
			}
		}
	}
	http.open("GET",url_,true);
	http.send();
}

This entry was posted in WebHosting, HTML, JS By .