forked from jquery/api.jquery.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeferred.reject.xml
19 lines (19 loc) · 1.41 KB
/
deferred.reject.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?xml version="1.0"?>
<entry name="deferred.reject" type="method" return="Deferred">
<title>deferred.reject()</title>
<signature>
<added>1.5</added>
<argument name="args" type="Anything" optional="true">
<desc>
Optional arguments that are passed to the failCallbacks.
</desc>
</argument>
</signature>
<desc> Reject a Deferred object and call any failCallbacks with the given <code>args</code>. </desc>
<longdesc>
<p>Normally, only the creator of a Deferred should call this method; you can prevent other code from changing the Deferred's state by returning a restricted Promise object through <a href="/deferred.promise/"><code>deferred.promise()</code></a>.</p>
<p>When the Deferred is rejected, any failCallbacks added by <a href="/deferred.then/"><code>deferred.then()</code></a> or <a href="/deferred.fail/"><code>deferred.fail()</code></a> are called. Callbacks are executed in the order they were added. Each callback is passed the <code>args</code> from the <code>deferred.reject()</code> call. Any failCallbacks added after the Deferred enters the rejected state are executed immediately when they are added, using the arguments that were passed to the <code>deferred.reject()</code> call. For more information, see the documentation for <a href="/jQuery.Deferred/">jQuery.Deferred()</a>.</p>
</longdesc>
<category slug="deferred-object"/>
<category slug="version/1.5"/>
</entry>