JQuery

Delayed object-deferred.fail(failCallbacks[,failCallbacks])

Delayed object-deferred.fail(failCallbacks[,failCallbacks]), someone asked me to explain?

Overview

Call a function or array function when the delay fails.

This parameter can be a function or an array of functions. When the delay fails, doneCallbacks is called. The callback execution is in the order they were added. Once deferred.fail() returns a lingering object, other methods of templating the object can also be linked here, including adding the .done() method. When the delay is resolved, the doneCallbacks execution is called with the parameters supplied to the resolve or resolveWith methods in the order they were added. For more information, see Deferred object .

parameter

failCallbacksFunction/ArrayV1.5

a function or array function that is called when the delay fails

failCallbacksFunction/ArrayV1.5

Additional optional function or array function, called when the delay fails

Example

description:

Once the jQuery.get method returns a jqXHR object, this is derived from a deferred, and the success and failure callbacks can be attached using the deferrred.done() and deferred.fail() methods.

jQuery code:
 $.get("test.php")
   .done(function () {
       alert("$.get succeeded");
   })
   .fail(function () {
       alert("$.get failed!");
   });

 

 

Post your comments / questions