Tuesday, September 6, 2022

[FIXED] What are the possible values for `jqXHR.status`?

Issue

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].'; }

Solution

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.



Answered By - hvgotcodes
Answer Checked By - David Goodson (PHPFixing Volunteer)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.