jQuery Deferred Methods

Last Updated:

jQuery Deferred Methods

The following are the list of Deferred methods available in jQuery.

MethodExplanation
deferred.always() Adds handlers to be called when the Deferred object is either resolved or rejected.
deferred.done() Adds handlers to be called when the Deferred object is resolved.
deferred.fail() Adds handlers to be called when the Deferred object is rejected.
deferred.notify() Calls the progressCallbacks added by deferred.then() or deferred.progress() with the given arguments.
deferred.notifyWith() Calls the progressCallbacks added by deferred.then() or deferred.progress() with the given context and arguments.
deferred.progress() Adds handlers to be called when the Deferred object generates progress notifications.
deferred.promise() Returns a Deferred's Promise object.
deferred-resolve() Resolves a Deferred object and call any doneCallbacks with the given arguments.
deferred.resolveWith() Resolves a Deferred object and call any doneCallbacks with the given context and array of arguments.
deferred.reject() Rejects a Deferred object and call any failCallbacks with the given arguments.
deferred.rejectWith() Rejects a Deferred object and call any failCallbacks with the given context and array of arguments.
deferred.state() Determines the current state of a Deferred object.
deferred.then() Adds handlers to be called when the Deferred object is resolved, rejected, or still in progress.
when() Provides a way to execute callback functions based on zero or more Deferred objects that represent asynchronous events.

Share this Page

Meet the Author