61,112
社区成员
发帖
与我相关
我的任务
分享
var XMLHttp=function(){
try {return new ActiveXObject("Msxml5.XMLHTTP");}catch(e){}
try {return new ActiveXObject("Msxml4.XMLHTTP");}catch(e){}
try {return new ActiveXObject("Msxml3.XMLHTTP");}catch(e){}
try {return new ActiveXObject("Msxml2.XMLHTTP");}catch(e){}
try {return new ActiveXObject("Microsoft.XMLHTTP");}catch(e){}
try {return new XMLHttpRequest();}catch(e){}
return null;
}
function xml(url,data)
{
try{
var xmlHTTP=new XMLHttp();
xmlHTTP.open("POST",url,false);
xmlHTTP.setRequestHeader("Content-Type", "text/html");
xmlHTTP.setRequestHeader("charset", "gb2312");
xmlHTTP.send(data);
var result = xmlHTTP.status;
if(result==200)
{
return (xmlHTTP.responseText);
}
xmlHTTP=null;
}catch(e)
{
alert(e.name+':'+e.message);
}
}