无为清净楼资源网 Design By www.qnjia.com
复制代码 代码如下:
/**********************************************
* @author skyz
* @function javascript client ajax dealwith
* @datetime 2006-3-20
**********************************************
* Function: Create a httpRequest object
**********************************************/
function HttpRequest(){
this._httpRequest=null; //HttpRequest request object
this._callBack=null; //Call back function
this._domResult=true; //Result if dom object or text string
this._requestData=null; //Request data
this._requestResult=null; //HttpRequest result
this._stateString=null; //Current request state string
this._error=false; //Current if have error
this._callBackPara=null; //Current callback function parama
//internal method for get HttpRequestObject
this.init=function(){
//Judge if Not IE
if(window.XMLHttpRequest){
this._httpRequest=new XMLHttpRequest();
//Set request mime is text/xml
if(this._httpRequest.overrideMimeType){
this._httpRequest.overrideMimeType('text/xml');
}
}else if(window.ActiveXObject){
try{
this._httpRequest=new ActiveXObject("Msxml2.XMLHTTP");
}catch(ex){
try{
this._httpRequest=new ActiveXObject("Microsoft.XMLHTTP");
}catch(ex){
this._setMessage(ex,true);
return;
}
}
// this._httpRequest.setrequestheader("Content-Type","text/xml;charset=gb2312");
}
//Judge HttpRequest object create successful
if(!this._httpRequest){
this._setMessage("XMLHttpRequest 对象创建失败!请重试......",true);
return;
}
}
/*
* Function: Set the request header
* namePar:request's header name
* valuePar:request's header value
*/
this.doSetRequestHeader=function(namePar,valuePar){
if(this._error){
return;
}
this._httpRequest.setRequestHeader(namePar,valuePar);
}
/*
* Function: Set the request data
* dataPar:request's send data;
*/
this.doSetRequestData=function(dataPar){
if(this._error){
return;
}
this._requestData=dataPar;
}
/*
*Function get RequestHttp Object
*/
this._getRequestObj=function(){
if(this._error){
return;
}
return this._httpRequest;
}
/*
* Function:Set Callback function para
*/
this.doSetCallBack=function(callBack,paraData){
this._callBack=(callBack)?callBack:null;
this._callBackPara=(paraData)?paraData:null;
};
/*
* Function: Get current stateString
*/
this.doGetState=function(){
return this._stateString;
}
/*
* Function: get current Error
*/
this.doGetError=function(){
return this._error;
}
/*
*
*/
this.doCallBack=function(){
this._callBack(this._requestResult,this._callBackPara);
}
/*
* Function: Send the request
* urlPar: request's url path
* [methodPar]:request's method
* [domPar]: request's result is dom or string
*/
this.doSendResuest=function(urlPar,methodPar,obj,domPar,asyPar){
if(obj._error){
return;
}
methodPar=((methodPar)?methodPar:"GET");
asyPar=((asyPar)?asyPar:true);
this._domResult=(domPar)?domPar:obj._domResult;
try{
var a=this._getRequestObj();
a.onreadystatechange=function(){
if(obj._error){
return;
}
var readyStateTmp=a.readyState;
if(readyStateTmp==0){
obj._setMessage("未初始化!");
}else if(readyStateTmp==1){
obj._setMessage("正在读取中......");
}else if(readyStateTmp==2){
obj._setMessage("已经读取过!");
}else if(readyStateTmp==3){
obj._setMessage("正在逐个切换......");
}else if(readyStateTmp==4){
var statusTmp=a.status;
if(statusTmp==404){
obj._setMessage("未找到请求页面!",true);
}else if(window.location.href.indexOf("http")==-1 || statusTmp==200){
obj._setMessage("完成!");
if(this._domResult && window.XMLHttpRequest){
obj._requestResult=a.responseXml;
}else{
obj._requestResult=a.responseText;
}
if(obj._callBack){
obj.doCallBack();
}
}else{
obj._setMessage("未知错误!");
}
}else{
obj._setMessage("未知错误!");
}
}
a.open(methodPar,urlPar,asyPar);
// a.setRequestHeader("If-Modified-Since","0");
a.send(obj._requestData);
}catch(ex){
obj._setMessage(ex,true);
}
}
/*
* Function: Deal exception error
* exPar:error string
*/
this._setMessage=function(exPar,mark){
this._stateString=exPar.toString();
this._error=(mark)?mark:false;
}
}
本地下载
/**********************************************
* @author skyz
* @function javascript client ajax dealwith
* @datetime 2006-3-20
**********************************************
* Function: Create a httpRequest object
**********************************************/
function HttpRequest(){
this._httpRequest=null; //HttpRequest request object
this._callBack=null; //Call back function
this._domResult=true; //Result if dom object or text string
this._requestData=null; //Request data
this._requestResult=null; //HttpRequest result
this._stateString=null; //Current request state string
this._error=false; //Current if have error
this._callBackPara=null; //Current callback function parama
//internal method for get HttpRequestObject
this.init=function(){
//Judge if Not IE
if(window.XMLHttpRequest){
this._httpRequest=new XMLHttpRequest();
//Set request mime is text/xml
if(this._httpRequest.overrideMimeType){
this._httpRequest.overrideMimeType('text/xml');
}
}else if(window.ActiveXObject){
try{
this._httpRequest=new ActiveXObject("Msxml2.XMLHTTP");
}catch(ex){
try{
this._httpRequest=new ActiveXObject("Microsoft.XMLHTTP");
}catch(ex){
this._setMessage(ex,true);
return;
}
}
// this._httpRequest.setrequestheader("Content-Type","text/xml;charset=gb2312");
}
//Judge HttpRequest object create successful
if(!this._httpRequest){
this._setMessage("XMLHttpRequest 对象创建失败!请重试......",true);
return;
}
}
/*
* Function: Set the request header
* namePar:request's header name
* valuePar:request's header value
*/
this.doSetRequestHeader=function(namePar,valuePar){
if(this._error){
return;
}
this._httpRequest.setRequestHeader(namePar,valuePar);
}
/*
* Function: Set the request data
* dataPar:request's send data;
*/
this.doSetRequestData=function(dataPar){
if(this._error){
return;
}
this._requestData=dataPar;
}
/*
*Function get RequestHttp Object
*/
this._getRequestObj=function(){
if(this._error){
return;
}
return this._httpRequest;
}
/*
* Function:Set Callback function para
*/
this.doSetCallBack=function(callBack,paraData){
this._callBack=(callBack)?callBack:null;
this._callBackPara=(paraData)?paraData:null;
};
/*
* Function: Get current stateString
*/
this.doGetState=function(){
return this._stateString;
}
/*
* Function: get current Error
*/
this.doGetError=function(){
return this._error;
}
/*
*
*/
this.doCallBack=function(){
this._callBack(this._requestResult,this._callBackPara);
}
/*
* Function: Send the request
* urlPar: request's url path
* [methodPar]:request's method
* [domPar]: request's result is dom or string
*/
this.doSendResuest=function(urlPar,methodPar,obj,domPar,asyPar){
if(obj._error){
return;
}
methodPar=((methodPar)?methodPar:"GET");
asyPar=((asyPar)?asyPar:true);
this._domResult=(domPar)?domPar:obj._domResult;
try{
var a=this._getRequestObj();
a.onreadystatechange=function(){
if(obj._error){
return;
}
var readyStateTmp=a.readyState;
if(readyStateTmp==0){
obj._setMessage("未初始化!");
}else if(readyStateTmp==1){
obj._setMessage("正在读取中......");
}else if(readyStateTmp==2){
obj._setMessage("已经读取过!");
}else if(readyStateTmp==3){
obj._setMessage("正在逐个切换......");
}else if(readyStateTmp==4){
var statusTmp=a.status;
if(statusTmp==404){
obj._setMessage("未找到请求页面!",true);
}else if(window.location.href.indexOf("http")==-1 || statusTmp==200){
obj._setMessage("完成!");
if(this._domResult && window.XMLHttpRequest){
obj._requestResult=a.responseXml;
}else{
obj._requestResult=a.responseText;
}
if(obj._callBack){
obj.doCallBack();
}
}else{
obj._setMessage("未知错误!");
}
}else{
obj._setMessage("未知错误!");
}
}
a.open(methodPar,urlPar,asyPar);
// a.setRequestHeader("If-Modified-Since","0");
a.send(obj._requestData);
}catch(ex){
obj._setMessage(ex,true);
}
}
/*
* Function: Deal exception error
* exPar:error string
*/
this._setMessage=function(exPar,mark){
this._stateString=exPar.toString();
this._error=(mark)?mark:false;
}
}
本地下载
标签:
AJAX简历系统
无为清净楼资源网 Design By www.qnjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
无为清净楼资源网 Design By www.qnjia.com
暂无评论...
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。
更新日志
2024年11月16日
2024年11月16日
- 第五街的士高《印度激情版》3CD [WAV+CUE][2.4G]
- 三国志8重制版哪个武将智力高 三国志8重制版智力武将排行一览
- 三国志8重制版哪个武将好 三国志8重制版武将排行一览
- 三国志8重制版武将图像怎么保存 三国志8重制版武将图像设置方法
- 何方.1990-我不是那种人【林杰唱片】【WAV+CUE】
- 张惠妹.1999-妹力新世纪2CD【丰华】【WAV+CUE】
- 邓丽欣.2006-FANTASY【金牌大风】【WAV+CUE】
- 饭制《黑神话》蜘蛛四妹手办
- 《燕云十六声》回应跑路:年内公测版本完成95%
- 网友发现国内版《双城之战》第二季有删减:亲亲环节没了!
- 邓丽君2024-《漫步人生路》头版限量编号MQA-UHQCD[WAV+CUE]
- SergeProkofievplaysProkofiev[Dutton][FLAC+CUE]
- 永恒英文金曲精选4《TheBestOfEverlastingFavouritesVol.4》[WAV+CUE]
- 群星《国风超有戏 第9期》[320K/MP3][13.63MB]
- 群星《国风超有戏 第9期》[FLAC/分轨][72.56MB]