ajax浏览器兼容函数,ajax 兼容,浏览器兼容,ajax刘拉起兼容性
function createXMLHttpRequest() {
if(window.XMLHttpRequest) {
XMLHttpReq = new XMLHttpRequest();
}
else if (window.ActiveXObject) {
try {
XMLHttpReq = new ActiveXObject( "Msxml2.XMLHTTP ");
} catch (e) {
try {
XMLHttpReq = new ActiveXObject( "Microsoft.XMLHTTP ");
} catch (e) {
alert( "create object fail ");
}
}
}
}
更多信息请查看IT技术专栏