l2.XMLHTTP各个版本及Microsoft.XMLHTTP并创建对象返回。
4///</summary>
5function Ajax_GetXMLHttpRequest() {
6 if (window.XMLHttpRequest) {
7 return new XMLHttpRequest();
8 } else {
9 if (window.Ajax_XMLHttpRequestProgID) {
return new ActiveXObject(window.Ajax_XMLHttpRequestProgID);
} else {
var progIDs = ["Msxml2.XMLHTTP.5.0", "Msxml2.XMLHTTP.4.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP", "Microsoft.XMLHTTP"];
for (var i = 0; i < progIDs.length; ++i) {
var progID = progIDs[i];
try {
var x = new ActiveXObject(progID);
window.Ajax_XMLHttpRequestProgID = progID;
return x;
} catch (e) {
}
}
}
}
return null;
}
/**////<summary>
///Ajax回调。
///</summary>
///<param name="type">调用服务端函数所在的类包括命名空间(如:NExplus.Controls.SiteHeader)。</param>
///<param name="id">客户端所对应的标记的ID(如:<div id="ID"></div>)。</param>
///<param name="method">服务端(方法)函数名称(被AjaxMethod标记)。</param>
///<param name="args">传到服务器的字符串。</param>
///<param name="clientCallBack">同步或异步回调。</param>
///<param name="debugRequestText">调试/请求字符串。</param>
///<param name="debugResponseText">调试/输出字符串。</param>
///<param name="debugErrors">调试的错误信息。</param>
///<param name="includeControlValuesWithCallBack">