我爱Aspx >> C#.Net >> 用.net 处理xmlHttp发送异步请求_ASP.NET技巧xmlHttp对象
/**//*
url-loading object and a request queue built on top of it
*/
/**//* namespacing object */
var net=new Object();
net.READY_STATE_UNINITIALIZED=0;
net.READY_STATE_LOADING=1;
net.READY_STATE_LOADED=2;
net.READY_STATE_INTERACTIVE=3;
net.READY_STATE_COMPLETE=4;
/**//*--- content loader object for cross-browser requests ---*/
net.xmlHttp=function(url, onload, params, method, contentType, onerror){
this.req=null;
this.onload=onload;
this.onerror=(onerror) ? onerror : this.defaultError;
if(typeof(method) == "undefined" || method == null)
{
method = "POST";
}
this.loadXMLDoc(url, params, method, contentType);
}
net.xmlHttp.prototype.loadXMLDoc=function(url, params, method, contentType){
if (!method){
method="GET";
}
if (!contentType && method=="POST"){
contentType='application/x-www-form-urlencoded';
}
if (window.XmlHttpRequest){
this.req=new XmlHttpRequest();
} else if (window.ActiveXObject){
this.req=new ActiveXObject("Microsoft.xmlHttp");
}
if (this.req){
try{
var loader=this;
this.req.onreadystatechange=function(){
net.xmlHttp.onReadyState.call(loader);
}
this.req.open(method,url,true);
if (contentType){
this.req.setRequestHeader('Content-Type', contentType);
Ҷƪл˵?
Ajax核心:XMLHTTP组件相关技术资..[04-28]
XMLHTTP对象封装技术_Ajax[04-28]
优化MICROSOFT ACCESS提高速度_A..[04-28]
最优化ASP程序性能_ASP技巧[04-28]
ASP中优化数据库处理_ASP技巧[04-28]
在ASP中优化数据库处理_ASP技巧[04-28]
最大限度优化你的Asp性能_ASP技巧[04-28]
用ASP编写计数器的优化方法_ASP技..[04-28]
ASPX页Web服务调用性能优化_ASP...[04-28]
微软建议的ASP性能优化28条守则_..[04-28]
Ajax核心:XMLHTTP组件相关技术资..[04-28]
XMLHTTP对象封装技术_Ajax[04-28]
优化MICROSOFT ACCESS提高速度_A..[04-28]
最优化ASP程序性能_ASP技巧[04-28]
MySQL优化全攻略-相关数据库命令..[04-28]
MySQL优化全攻略-服务器参数调整..[04-28]
MySQL怎样优化WHERE子句_数据库技..[04-28]
怎样获得SQL Server的优化性能?..[04-28]
ASP中优化数据库处理_ASP技巧[04-28]
在ASP中优化数据库处理_ASP技巧[04-28]