var request = new XMLHttpRequest();
request.open("GET","get.php",ture);
request.send();
request.onreadystatechange = function(){
if(request.readyState ===4&& request.status===200)
//执行一些事情request.responseText
}
request.open("GET","get.php",ture);
request.send();
request.onreadystatechange = function(){
if(request.readyState ===4&& request.status===200)
//执行一些事情request.responseText
}
2016-05-31
var request;
if(windos.XMLHttprequest){
request = new XMLHttprequest();
} else{
request = new AativeXObject("microsoft.XMLHTTP");
}
if(windos.XMLHttprequest){
request = new XMLHttprequest();
} else{
request = new AativeXObject("microsoft.XMLHTTP");
}
2016-05-31
已采纳回答 / 慕少1561027
4 一般指接收到响应数据的状态:0:未初始化。new完后;1:已打开。对象已经创建并初始化,但还未调用send方法2:已发送。已经调用send 方法,但该对象正在等待状态码和头的返回;3:正在接收。已经接收了部分数据,但还不能使用该对象的属性和方法,因为状态和响应头不完整;4:已加载。所有数据接收完毕
2016-05-30