jQuery deferred.resolve()Method

jQuery 杂项方法jQuery Miscellaneous Methods


Definition and Usage

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


Note:1. Usually only the creator of the deferred object can call this method. You can use 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 will be called. The callback functions are executed in the order they were added. The args parameter passed to deferred.resolve() is passed to each callback function. Once the deferred object enters the resolved state, any doneCallbacks added afterwards are executed immediately with the arguments passed to .resolve().


Syntax

deferred.resolve( args )

Parameter Description
args Object type - pass an optional array of arguments to the doneCallbacks callback functions.


jQuery 杂项方法jQuery Miscellaneous Methods

Other Extensions