I try to access the statusText on a post back to the server when an error occured. On the server side I’m setting the status text to an error message. StatusCode is 500 and statusText the error description.
Chrome console output inside the Headers section is:
Status Code:500 (big red dot) Error Message: Something went wrong.
But when I try to access the statusText now inside of the .error() function callback there is always the text “error”:
.error(function (xhr, text) {
alert(xhr.statusText);
});
Is jQuery overwriting this field or how can I access the original values?
Thanks for help!
I think you need to see the 3rd argument to the callback, it should be the HTTP status text. (according to the jQuery API documentation for the error callback)