Description

The .ajaxSend() Ajax method, allows us to register an Ajax Event handler to be called before Ajax requests are sent.

The .ajaxSend() method callbacks are executed via the ajaxSend event which is triggered every time an Ajax request is about to be sent. For finer grained control of
callback execution when the .ajaxSend() Ajax method is fired, interrogate the event and jqXHR objects or the ajaxSettings parameters passed to the method.

Return

Register an Ajax Event handler to be called before Ajax requests are sent.

In the example below when we press the button the first time, we use the .ajaxSend() method to set up a global event handler to be run for each Ajax request. The handler is fired every time an Ajax request is about to be sent. In this case the handler outputs a message giving some information about the request to be sent.