ASP.NET Ajax In Action!

时间:2022-03-20 07:28:51

创建XMLHTTPRequest

代码

Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1 var xmlHttp = null;
if (window.XMLHttpRequest) {
    xmlHttp = new XMLHttpRequest(); //IE7,Firefox,opera
} else if (window.ActiveXObject) {
    try
    {
      xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");//IT6,IT5
    }
    catch(e){}
   
}