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
jqueryajax即使出错也能获取数据_Jquery_Ajax - Fatal编程技术网

jqueryajax即使出错也能获取数据

jqueryajax即使出错也能获取数据,jquery,ajax,Jquery,Ajax,使用ajax jquery时,如果服务器响应404、400或任何4xx http响应,则不会返回url返回的实际数据 我的应用程序发送400个包含错误的json数据响应 我想让我的ajax将json返回到dom中,这样我就可以看到发生了什么错误。有一个responseText属性,你检查过了吗?@BlackSheep theresponseText只返回error。你的代码在哪里?以及从服务器发送的responseText的示例?

使用ajax jquery时,如果服务器响应404、400或任何4xx http响应,则不会返回url返回的实际数据

我的应用程序发送400个包含错误的json数据响应


我想让我的ajax将json返回到dom中,这样我就可以看到发生了什么错误。

有一个
responseText
属性,你检查过了吗?@BlackSheep the
responseText
只返回
error
。你的代码在哪里?以及从服务器发送的responseText的示例?