Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从jQuery中的成功ajax事件访问XMLHttpRequest_Jquery_Ajax_Xmlhttprequest_Http Status Codes - Fatal编程技术网

从jQuery中的成功ajax事件访问XMLHttpRequest

从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”ajax事件被传递给XMLHttpRequest对象,“success”没有

这太遗憾了,因为我希望能够成功访问HTTP状态代码。我这样做是成功的错误

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
}