87,990
社区成员
发帖
与我相关
我的任务
分享var ajax = {//xmlhttp request
tryList:function(){
var xhr = null;
for(var i=0;i<arguments.length;i++){
var lambda = arguments[i];
try{xhr = lambda();break;}catch(e){}
}
return xhr;
},
init:function(){
return this.tryList(
function(){return new ActiveXObject('MSXML2.XMLHttp.6.0');},
function(){return new ActiveXObject('MSXML2.XMLHttp.3.0');},
function(){return new XMLHttpRequest();},
function(){return new ActiveXObject('MSXML2.XMLHttp.5.0');},
function(){return new ActiveXObject('MSXML2.XMLHttp.4.0');},
function(){return new ActiveXObject('Msxml2.XMLHTTP');},
function(){return new ActiveXObject('MSXML.XMLHttp');},
function(){return new ActiveXObject('Microsoft.XMLHTTP');}
) || null;
}
}
var xmlhttp = ajax.init();
xmlhttp.open("GET","pic_list.xml",false);
xmlhttp.send(null);
xmlDoc=xmlhttp.responseXML;