Skip to content

Commit 36e1316

Browse files
committed
deferred.catch: create the page
Fixes jquery#951 Closes jquery#992
1 parent 1c249b2 commit 36e1316

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

entries/deferred.catch.xml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0"?>
2+
<entry name="deferred.catch" type="method" return="Promise">
3+
<title>deferred.catch()</title>
4+
<signature>
5+
<added>3.0</added>
6+
<argument name="failFilter" type="Function">
7+
<desc>
8+
A function that is called when the Deferred is rejected.
9+
</desc>
10+
</argument>
11+
</signature>
12+
<desc>Add handlers to be called when the Deferred object is rejected. </desc>
13+
14+
<longdesc>
15+
<p><code>deferred.catch( fn )</code> is an alias to <a href="/deferred.then/"><code>deferred.then( null, fn )</code></a>. Read its page for more information.</p>
16+
</longdesc>
17+
<example>
18+
<desc>Since the <a href="/jQuery.get/"><code>jQuery.get</code></a> method returns a jqXHR object, which is derived from a Deferred object, we can rejection handlers using the <code>.catch</code> method.</desc>
19+
<code><![CDATA[
20+
$.get( "test.php" )
21+
.then( function() {
22+
alert( "$.get succeeded" );
23+
} )
24+
.catch( function() {
25+
alert( "$.get failed!" );
26+
} );
27+
]]></code>
28+
</example>
29+
<category slug="deferred-object"/>
30+
<category slug="version/3.0"/>
31+
</entry>

0 commit comments

Comments
 (0)