It helps to attach a function to be executed before an Ajax request is sent.
// To add a log, when an AJAX requests is about to be sent. It will bind when requesting the ajax action.
$( document ).ajaxSend(function() {
$( “.log” ).text( “Triggered ajaxSend handler.” );
});