我有同样的问题。我返回一个字符串,因为它是由异常构成的。例如,我在Symfony2项目上使用带有序列化到json的内核侦听器。这对于正确的REST标头是正确的。
无论如何,只需解析它;这对我有用:
$.ajaxSetup({ "error": function(jqXHR, status, thrownError) { alert('error'); var responseText = jQuery.parseJSON(jqXHR.responseText); console.log(responseText); }});


