js部分
//生成Ajax的调用对象
functioncreatAjax()
{
varHttpRequest=false;
try{
HttpRequest=newXMLHttpRequest();
}catch(e){
vararrXMLHTTP=["Msxml3.XMLHTTP","Msxml2.XMLHTTP","Microsoft.XMLHTTP"];
for(vari=0;i<arrXMLHTTP.length;i++){
try{
HttpRequest=newActiveXObject(arrXMLHTTP[i]);
}catch(e){}
if(HttpRequest)break;
}
}
returnHttpRequest;
}