适用于多浏览器的xmlHttp

var xmlHttp=null;
try
{
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP")
}
catch(e)
{
    try
    {
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP")
    }
    catch(oc)
    {
        xmlHttp=null
    }
}
        
if ( !xmlHttp && typeof XMLHttpRequest != "undefined" )
{
    xmlHttp = new XMLHttpRequest()
}
                
 xmlHttp.open("POST", url, false);
 xmlHttp.send("");
 result = xmlHttp.responseText;

原文地址:https://www.cnblogs.com/xgw2004058/p/1753912.html