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 .

About Weil Jimmer

avatar

Hi! Everyone! My name is Weil Jimmer. This is my personal blog. I'm a webmaster of this site. I hope the site will be popular. Now, Let's go! Enjoy gaining more knowledge.

Leave a Reply

Privacy: