This seems 101-level, but I can’t find an answer! (instead I find links to what to do on success or failures, jQuery’s ajax().success and the like.
My hunch is:
success: 200 HTTP return codefailure: anything else.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is not really an AJAX, but jQuery question, because the success callback is only characteristic of jQuery, not AJAX on the whole.
From the jQuery source you can see how it is implemented
So, basically if the HTTP response code is between 200 and 299 (inclusive) or 304 it goes for the
successcallback, otherwise, it is theerrorcallback.