XMLHTTP---介绍(4)
发布时间:2021-06-05
发布时间:2021-06-05
XMLHTTP---介绍
var xmlHttpRequest;
function CreateXMLHttp()
{
if (window.XMLHttpRequest)
{ //针对Firefox, Mozillar, Opera, Safari, IE7, IE8
xmlHttpRequest=new XMLHttpRequest();
}
else if (window.ActiveXObject)
{ //针对IE6, IE5.5, IE5 前面的ActiveX插件版本较新
var activeName=["MSXML2.XMLHTTP", "Microsoft.XMLHTTP"]; for (var i=0;i<activeName.length;i++)
{
xmlHttpRequest = new ActiveXObject(activeName[i]); }
}
return xmlHttpRequest;
}