重新修正了一下javascrit ajax的实例
var xmlhttp=null;
if(window.XMLHttpRequest){
xmlhttp=new window.XMLHttpRequest();
}else if(window.ActiveXObject){
try{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}catch (e){
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}else{
alert("您的浏览器不支持Ajax!");
}
if(xmlhttp){
xmlhttp.onreadystatechange=function(){
if (xmlhttp.readyState==0) {
console.log(xmlhttp.readyState);
};
if (xmlhttp.readyState==1) {
console.log(xmlhttp.readyState);
};
if (xmlhttp.readyState==2) {
console.log(xmlhttp.readyState);
};
if (xmlhttp.readyState==3) {
console.log(xmlhttp.readyState);
};
if(xmlhttp.readyState==4&&xmlhttp.status==200){
console.log(xmlhttp.readyState);
}
}
xmlhttp.open('GET','http://www.5itbao.cn');
xmlhttp.send();
}