JQuery

Delayed object-deferred.always(alwaysCallbacks,[alwaysCallbacks])

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

Overview

The add handler is called when the deferred object is resolved or rejected.

parameter

alwaysCallbacksV1.6

A function, or array of functions, that is called when a deferred object is resolved or rejected.

alwaysCallbacksV1.6

An optional optional function, or array of functions, is called when the deferred object is resolved or rejected.

Example

description:

The jQuery.get() method returns a jqXHR object from a delayed object, and we can attach a success and error using the callback of the deferred.always() method.

jQuery code:
$.get("test.php").always(function () {
        alert("$.get completed with success or error callback arguments");
    });

 

 

Post your comments / questions