jQuery\'s AJAX error function has the following parameters:
error(XMLHttpRequest, textStatus, errorThrown)
What\'s the best cross-browser w
For a more recent and general answer (since jquery 1.5), I'd use the jqXHR object:
$.ajax(url).fail(function(jqXHR, textStatus, errorThrown) {
alert(jqXHR.responseText);
})
Alternatively responseJSON can be used to get the response body already parsed
$.ajax(url).fail(function(jqXHR, textStatus, errorThrown) {
console.log(jqXHR.responseJSON);
})