从jQuery中的成功ajax事件访问XMLHttpRequest
根据文档,“error”ajax事件被传递给XMLHttpRequest对象,“success”没有 这太遗憾了,因为我希望能够成功访问HTTP状态代码。我这样做是成功的错误从jQuery中的成功ajax事件访问XMLHttpRequest,jquery,ajax,xmlhttprequest,http-status-codes,Jquery,Ajax,Xmlhttprequest,Http Status Codes,根据文档,“error”ajax事件被传递给XMLHttpRequest对象,“success”没有 这太遗憾了,因为我希望能够成功访问HTTP状态代码。我这样做是成功的错误 error: function(data){ alert(data.status) } 任何线索都很好 谢谢。在本例中,您将查找成功后发生的complete()回调: // A function to be called when the request finishes // (after success
error: function(data){
alert(data.status)
}
任何线索都很好
谢谢。在本例中,您将查找成功后发生的complete()回调:
// A function to be called when the request finishes
// (after success and error callbacks are executed).
// The function gets passed two arguments: The
// XMLHttpRequest object and a string describing the
// type of success of the request. This is an Ajax Event.
complete: function (XMLHttpRequest, textStatus) {
this; // the options for this ajax request
}
在本例中,您将查找成功后发生的complete()回调:
// A function to be called when the request finishes
// (after success and error callbacks are executed).
// The function gets passed two arguments: The
// XMLHttpRequest object and a string describing the
// type of success of the request. This is an Ajax Event.
complete: function (XMLHttpRequest, textStatus) {
this; // the options for this ajax request
}