alega
alega

Reputation: 37

What event fires when an AJAX request is sent?

What handler should I use to catch the moment when an AJAX request has just been sent to the server within document.ready?

Upvotes: 3

Views: 136

Answers (2)

subhaze
subhaze

Reputation: 8855

You might be looking for .ajaxSend() or .ajaxStart() Jquery AJAX events

Upvotes: 1

user492203
user492203

Reputation:

I think you're looking for .ajaxComplete().

$('#el').ajaxComplete(function() {
    …
});

Edit

Try this:

$(window).ajaxComplete(function() {
    …
});

Note: these only work if the AJAX request was sent with jQuery.

Upvotes: 2

Related Questions