Примеры для jQuery deferred.always()


Since the jQuery.get() method returns a jqXHR object, which is derived from a Deferred object, we can attach a callback for both success and error using the deferred.always() method.

1
2
3
$.get( "test.php" ).always(function() {
alert( "$.get completed with success or error callback arguments" );
});