Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/82.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/6.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
jqueryajax与错误处理_Jquery - Fatal编程技术网

jqueryajax与错误处理

jqueryajax与错误处理,jquery,Jquery,我很难找到关于jQueryAjax错误的文档。我想创建一个函数,该函数能够获取为报告错误而调用的web服务的名称 在error函数中是否有方法获取被调用函数的名称 error: function() { //not sure what is available here } 如果您能提供有关错误函数的任何文档,我将不胜感激。请看一下这个问题: 错误函数为: error:function (xhr, ajaxOptions, thrownError){ consol

我很难找到关于jQueryAjax错误的文档。我想创建一个函数,该函数能够获取为报告错误而调用的web服务的名称

在error函数中是否有方法获取被调用函数的名称

   error: function() {
       //not sure what is available here
   }

如果您能提供有关错误函数的任何文档,我将不胜感激。

请看一下这个问题:

错误函数为:

error:function (xhr, ajaxOptions, thrownError){
  console.dir(xhr);
  console.dir(thrownError);
}
其中xhr是XMLHttpRequest。您可以使用FireBug的console.dir获取其属性