jQuery deferred.reject()Method
Definition and Usage
The deferred.reject() function is used to reject a Deferred object and call any failCallbacks callback functions with the given arguments.
Note:1. Usually only the creator of the Deferred object can call this method. You can return a restricted Promise object by calling deferred.promise() to prevent other code from changing the state of the Deferred object or reporting its status.
2. When the Deferred object is rejected, any failCallbacks added via deferred.then or deferred.fail will be called. The callback functions are executed in the order they were added. The args parameters passed to deferred.reject() will be passed to each callback function. After the Deferred object enters the rejected state, any failCallbacks added later will be executed immediately, with the arguments passed to .reject().
Syntax
| Parameters | Description |
|---|---|
| args | Object type Optional parameters passed to the fail callback functions (failCallbacks) |
Other Extensions
jQuery Miscellaneous Methods