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 withi开发者_StackOverflow社区n document.ready
?
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.
You might be looking for .ajaxSend()
or .ajaxStart()
Jquery AJAX events
精彩评论