Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…
Cannot retrieve contributors at this time
31 lines (31 sloc) 1.98 KB
<?xml version="1.0"?>
<entry name="" type="method" return="Deferred">
<argument name="failCallbacks" type="Function">
A function, or array of functions, that are called when the Deferred is rejected.
<argument name="failCallbacks" type="Function" optional="true">
Optional additional functions, or arrays of functions, that are called when the Deferred is rejected.
<desc> Add handlers to be called when the Deferred object is rejected. </desc>
<p>The <code></code> method accepts one or more arguments, all of which can be either a single function or an array of functions. When the Deferred is rejected, the failCallbacks are called. Callbacks are executed in the order they were added. Since <code></code> returns the deferred object, other methods of the deferred object can be chained to this one, including additional <code></code> methods. The failCallbacks are executed using the arguments provided to the <a href="deferred.reject"><code>deferred.reject()</code></a> or <a href="deferred.rejectWith"><code>deferred.rejectWith()</code></a> method call in the order they were added. For more information, see the documentation for <a href="/category/deferred-object/">Deferred object</a>.</p>
<desc>Since the <a href=""><code>jQuery.get</code></a> method returns a jqXHR object, which is derived from a Deferred, you can attach a success and failure callback using the <code>deferred.done()</code> and <code></code> methods.</desc>
.done(function(){ alert("$.get succeeded"); })
.fail(function(){ alert("$.get failed!"); });
<category slug="deferred-object"/>
<category slug="version/1.5"/>
Jump to Line
Something went wrong with that request. Please try again.