Skip to content Skip to sidebar Skip to footer

JQuery Deferred Method And Ajax BeforeSend()

By using the deferred object in $.ajax the success-callback can replaced by the deferred-method done() the error-callback acn replaced by the deferred-method fail() and the compl

Solution 1:

You could attach the global jQuery event ajaxStart to whatever element is triggering your AJAX request. That should essentially replicate the functionality of beforeSend.

$(".ajax").ajaxStart(function() {
    $(".document").append("AJAX begun");
});

Fiddle.


Post a Comment for "JQuery Deferred Method And Ajax BeforeSend()"