//定义xmlhttprequest对象
var xmlrequest;
//完成xmlhttprequest对象的初始化
function createXMLHttpRequest() {
if (window.XMLHttpRequest) {
//DOM2浏览器
xmlrequest = new XMLHttpRequest();
}
else if (window.ActiveXObject) {
//将Internet Explorer的不同xmlhttp实现声明成数组
var MSXML = ['MSXML2.XMLHTTP.5.0','MSXML2.XMLHTTP.4.0',
'MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP', 'Microsoft.XMLHTTP'];
//依次对每个XMLHTTP实现创建XMLHttpRequest对象
for(var n= 0;n<MSXML.length;n++){
try{
xmlrequest=new ActiveXObject(MSXML[n]);
break;
}
catch (e){}
}
}
}
var xmlrequest;
//完成xmlhttprequest对象的初始化
function createXMLHttpRequest() {
if (window.XMLHttpRequest) {
//DOM2浏览器
xmlrequest = new XMLHttpRequest();
}
else if (window.ActiveXObject) {
//将Internet Explorer的不同xmlhttp实现声明成数组
var MSXML = ['MSXML2.XMLHTTP.5.0','MSXML2.XMLHTTP.4.0',
'MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP', 'Microsoft.XMLHTTP'];
//依次对每个XMLHTTP实现创建XMLHttpRequest对象
for(var n= 0;n<MSXML.length;n++){
try{
xmlrequest=new ActiveXObject(MSXML[n]);
break;
}
catch (e){}
}
}
}