Why is jqXHR.responseText returning a string instead of a JSON object?
I had the same problem. I returns a string because it formulated from an exception. E.g. I use a kernel listener with serialization to json on my Symfony2 project. Which is correct for proper REST headers. Anyway, just parse it; this works for me: $.ajaxSetup({ “error”: function(jqXHR, status, thrownError) { alert(‘error’); var responseText = jQuery.parseJSON(jqXHR.responseText); … Read more