function yzXmlRequest(url,params,method,async,username,password)
{
this.url=url;
this.params=params;
this.method=method||'POST';
this.async=(async!=null)?async:true;
this.username=username;
this.password=password;
};
yzXmlRequest.prototype.url=null;
yzXmlRequest.prototype.params=null;
yzXmlRequest.prototype.method=null;
yzXmlRequest.prototype.async=null;
yzXmlRequest.prototype.username=null;
yzXmlRequest.prototype.password=null;
yzXmlRequest.prototype.request=null;
yzXmlRequest.prototype.isReady=function()
{
return this.request.readyState==4;
}
yzXmlRequest.prototype.getDocumentElement=function()
{
var doc=this.getXml();
if(doc!=null)
{
return doc.documentElement;
}
return null;
};
yzXmlRequest.prototype.getXml=function()
{
var xml=this.request.responseXML;
if(xml==null||xml.documentElement==null)
{
xml=mxUtils.parseXml(this.request.responseText);
}
return xml;
};
yzXmlRequest.prototype.getText=function()
{
return this.request.responseText;
};
yzXmlRequest.prototype.getStatus=function()
{
return this.request.status;
};
yzXmlRequest.prototype.create=function()
{
if(window.XMLHttpRequest)
{
return function()
{
return new XMLHttpRequest();
};
}
else if(typeof(ActiveXObject)!="undefined")
{
return function()
{
return new ActiveXObject("Microsoft.XMLHTTP");
};
}
}();
yzXmlRequest.prototype.send=function(onload,onerror)
{
this.request=this.create();
if(this.request!=null)
{
var self=this;
this.request.onreadystatechange=function()
{
if(self.isReady())
{
if(onload!=null)
{
onload(self);
}
}
}
this.request.open(this.method,this.url,this.async,this.username,this.password);
if(this.params!=null)
{
this.request.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
}
this.request.send(this.params);
}
};
{
this.url=url;
this.params=params;
this.method=method||'POST';
this.async=(async!=null)?async:true;
this.username=username;
this.password=password;
};
yzXmlRequest.prototype.url=null;
yzXmlRequest.prototype.params=null;
yzXmlRequest.prototype.method=null;
yzXmlRequest.prototype.async=null;
yzXmlRequest.prototype.username=null;
yzXmlRequest.prototype.password=null;
yzXmlRequest.prototype.request=null;
yzXmlRequest.prototype.isReady=function()
{
return this.request.readyState==4;
}
yzXmlRequest.prototype.getDocumentElement=function()
{
var doc=this.getXml();
if(doc!=null)
{
return doc.documentElement;
}
return null;
};
yzXmlRequest.prototype.getXml=function()
{
var xml=this.request.responseXML;
if(xml==null||xml.documentElement==null)
{
xml=mxUtils.parseXml(this.request.responseText);
}
return xml;
};
yzXmlRequest.prototype.getText=function()
{
return this.request.responseText;
};
yzXmlRequest.prototype.getStatus=function()
{
return this.request.status;
};
yzXmlRequest.prototype.create=function()
{
if(window.XMLHttpRequest)
{
return function()
{
return new XMLHttpRequest();
};
}
else if(typeof(ActiveXObject)!="undefined")
{
return function()
{
return new ActiveXObject("Microsoft.XMLHTTP");
};
}
}();
yzXmlRequest.prototype.send=function(onload,onerror)
{
this.request=this.create();
if(this.request!=null)
{
var self=this;
this.request.onreadystatechange=function()
{
if(self.isReady())
{
if(onload!=null)
{
onload(self);
}
}
}
this.request.open(this.method,this.url,this.async,this.username,this.password);
if(this.params!=null)
{
this.request.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
}
this.request.send(this.params);
}
};
互动营销专家(邮件营销,在线调查,事件营销)
http://www.supermore.com.cn