Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/73.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
Javascript .error()jquery函数中的详细错误消息_Javascript_Jquery - Fatal编程技术网

Javascript .error()jquery函数中的详细错误消息

Javascript .error()jquery函数中的详细错误消息,javascript,jquery,Javascript,Jquery,我正在使用.error()作为.post()的回调。比如: 如果发生错误,我想查看详细的错误消息。我怎么看出来?最好使用fail()而不是弃用的error()。最好使用fail()而不是弃用的error()。 $.post("url", function(data){}) .error(function(event, jqXHR, ajaxSettings, thrownError){ console.log(event, jqXHR, ajaxSettings, thrownEr

我正在使用.error()作为.post()的回调。比如:


如果发生错误,我想查看详细的错误消息。我怎么看出来?

最好使用
fail()
而不是弃用的
error()
。最好使用
fail()
而不是弃用的
error()
 $.post("url", function(data){})
 .error(function(event, jqXHR, ajaxSettings, thrownError){
     console.log(event, jqXHR, ajaxSettings, thrownError);
 });
 $.post("url", function(data){})
 .error(function(event, jqXHR, ajaxSettings, thrownError){
     console.log(event, jqXHR, ajaxSettings, thrownError);
 });