Thursday, 23 August 2012

ajax->success(), complete() methods difference



             All of jQuery's ajax methods return a jqXHR object that provides .error(),.success(), and .complete() methods. So, the difference between.success() and .complete() is .success() only gets called if your web server responds with a 200 OK HTTP 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.


No comments:

Post a Comment