What are the possible values for jqXHR.status
?
So far, I can see the following:
if (jqXHR.status === 0) { msg = 'Network Problem'; }
else if (jqXHR.status == 404) { msg = 'Requested page not found. [404]'; }
else if (jqXHR.status == 500) { msg = 'Internal Server Error [500].'; }
The jqXHR (jQuery XMLHttpRequest) replaces the browser native XMLHttpRequest object. jQuery wraps the browser native XMLHttpRequest object with a superset API. The jQuery XMLHttpRequest (jqXHR) object is returned by the $. ajax() function. The jqXHR object simulates native XHR functionality where possible.
If an AJAX request fails, you can react to the failure inside the callback function added via the fail() function of the object returned by the $. ajax() function. Here is a jQuery AJAX error handling example: var jqxhr = $.
It can be anything found here.
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
The status
value is the HTTP protocol status field that http servers send on the response.
Note at this point, the jquery ajax documentation indicates that status
is deprecated, and you should use statusCode
instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With