Jquery get data on XHR error

Viewed 29077

If I make a jquery AJAX request which is succesful I get back my JSON data. However, If I make a request and I get somthing other than a 200 response code back, I cannot get back the data in the Jquery call back. I need the data as it has a description about the data.

success: function (data, tst, xhr) {
    $.log('XHR OK');
},
error: function (xhr, tst, err) {
    $.log('XHR ERROR ' + XMLHttpRequest.status);
},

Any ideas?

Thanks

2 Answers
Related