Skip to content

Commit af5264b

Browse files
Matthew FlaschenAurelioDeRosa
Matthew Flaschen
authored andcommitted
jQuery.when: Returns a resolved promise for no arguments
Closes jquerygh-868
1 parent cc0604b commit af5264b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

entries/jQuery.when.xml

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
<signature>
55
<added>1.5</added>
66
<argument name="deferreds" type="Deferred">
7-
<desc>One or more Deferred objects, or plain JavaScript objects.</desc>
7+
<desc>Zero or more Deferred objects, or plain JavaScript objects.</desc>
88
</argument>
99
</signature>
10-
<desc>Provides a way to execute callback functions based on one or more objects, usually <a href="/category/deferred-object/">Deferred</a> objects that represent asynchronous events.</desc>
10+
<desc>Provides a way to execute callback functions based on zero or more objects, usually <a href="/category/deferred-object/">Deferred</a> objects that represent asynchronous events.</desc>
1111
<longdesc>
12+
<p>If no arguments are passed to <code>jQuery.when()</code>, it will return a resolved Promise.</p>
1213
<p>If a single Deferred is passed to <code>jQuery.when()</code>, its Promise object (a subset of the Deferred methods) is returned by the method. Additional methods of the Promise object can be called to attach callbacks, such as <a href="/deferred.then/"><code>deferred.then</code></a>. When the Deferred is resolved or rejected, usually by the code that created the Deferred originally, the appropriate callbacks will be called. For example, the jqXHR object returned by <code>jQuery.ajax()</code> is a Promise-compatible object and can be used this way:</p>
1314
<pre><code>
1415
$.when( $.ajax( "test.aspx" ) ).then(function( data, textStatus, jqXHR ) {

0 commit comments

Comments
 (0)