safari 浏览器 ajax请求

请求方式,适合多种浏览器

var xhr = null;
if(window.XMLHttpRequest){
this.xmlHttp = new XMLHttpRequest();
} else if(window.ActiveXObject){
try{
this.xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
}catch(e){
try{
this.xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}catch(e){
alert("Error:Construct XmlHttpObj["+e.description+"]");
}
}
}

safari不支持ajax中send按参数传递,参数只能跟在url后面,然后send(null)

猜你喜欢

转载自xfyzhy.iteye.com/blog/1833127