标签:
var xhr=null;
if(window.XMLHttpRequest){
xhr=new XmlHttpRequest();
}else{
xhr=new ActiveXObject("Mcosoft.XMLHttp")
}
xhr.onreadystatechange=function(){
if(xhr.readyState==4 && xhr.satus==200){
//得到字符串格式
var str=xhr.responseText
// 得到XML格式 var xml=xhr.responseXML;
console.log(”执行dom操作“);
}
}
xhr.open("get/post","xx.php",true/false);
//xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded")
xhr.send("null/data");
标签:
原文地址:http://www.cnblogs.com/zhangchong/p/4974002.html