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,