首页 > 编程知识 正文

error while copying,53ajax

时间:2023-05-05 23:37:19 阅读:119537 作者:3336

ihaveaproblemwiththeonreadystatechangewhenimakeajaxrequest,it used to call the function but

nowitdoesnotcalltheprocessrequest。

iamnotsureifieditedsomethingorwhat . cansombodyhelp .

功能性创建对象(URL,callback ) )。

{

///@par Implementation

var req=init (;

req.onreadystatechange=processrequest;

//@ briefcreatesaajaxobjectbasedontherunnunfbrowser

功能init ()

{

if(window.xmlhttprequest ) )。

返回new xmlhttprequest (;

ELSEif(window.activexobject ) )。

返回新活动对象(Microsoft.xmlhttp );

}

//@ briefchecksifrequestiscompleteandhttpcallissuccessful

function processRequest (

{

//ready state of 4信号完整性请求完成

if(req.readystate==4) {

//status of 200 signifiessucessfulhttpcall

if(req.Status==200 ) {

是呼叫后退(if )

callback(req.responsexml;

}

}

}

this.dopost=function(param ) {

if(req.readystate==4) {

//makeahttpgetrequesttothelydhcasynchronously

req.open('post ',url,true );

req.setrequestheader (内容类型,)应用程序/x-www-form-urlencoded );

req.setrequestheader (' content-length ',param.length );

req.setrequestheader (' connection ',' close ' );

req.send(param;

}

}

}

thanks,

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。