Deprecation Notice: The jqXHR.success(), jqXHR.error(), and jqXHR.complete() callbacks are deprecated as of jQuery 1.8. To prepare your code for their eventual removal, use jqXHR.done(), jqXHR.fail(), and jqXHR.always() instead.

Mutiple callbacks can be specified for an $.ajax() request. Callback methods .done(), fail(), always(), then.() are all promise methods of the jqXHR object. All these callback methods fire once the $.ajax() process terminates. Promise callbacks are invoked in the order they are registered.