What event fires when an AJAX request is sent?

Which handler should I use to catch the moment when the AJAX request was just sent to the server in document.ready?

+3
source share
2 answers

I think what you are looking for .ajaxComplete().

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

Edit

Try the following:

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

Note: they only work if the AJAX request was sent using jQuery.

+2
source

You may be looking for .ajaxSend()or .ajaxStart() jQuery AJAX Events

+2
source

Source: https://habr.com/ru/post/1792895/


All Articles