Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

jQuery deferred.resolve() method

jQuery deferred.resolve() method

jQuery Miscellaneous MethodsjQuery Miscellaneous Methods


Definition and Usage

The deferred.resolve() function is used to resolve a Deferred object and call any doneCallbacks with the given args.

**Note:** 1. Typically only the creator of the deferred object can call this method. You can call deferred.promise() to return a restricted Promise object, preventing other code from changing the state of the deferred object or reporting its state.
2. When the deferred object is resolved, any doneCallbacks added via deferred.then or deferred.done are called. The callbacks are executed in the order in which they were added. The args passed to deferred.resolve() are passed to each callback. After the deferred object enters the resolved state, any doneCallbacks added afterwards are executed immediately with the arguments passed to .resolve().


Syntax

deferred.resolve( args )

Parameters Description
args Object type: An optional array of arguments passed to the doneCallbacks

jQuery Miscellaneous MethodsjQuery Miscellaneous Methods