As of jQuery 1.5, all jQuery’s AJAX methods return a jqXHR object that provides .error(), .success(), and .complete() methods.
What is the difference between .success() and .complete()?
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.
.success()only gets called if your webserver responds with a200 OKHTTP header – basically when everything is fine.However,
.complete()will always get called no matter if the ajax call was successful or not – maybe it outputted errors and returned an error – .complete() will still get called.It’s worth mentioning that
.complete()will get called after.success()gets called – if it matters to you.