jQuery ajax - ajaxSend() method
Example
Change the content of the div element when the AJAX request is about to be sent:
$("div").ajaxSend(function(e,xhr,opt){ $(this).html("Requesting " + opt.url); );
Definition and usage
The ajaxSend() method executes a function when the AJAX request starts. It is an Ajax event.
Syntax
.ajaxSend([function(event,xhr,options)])
Parameters | Description |
---|---|
function(event,xhr,options) |
Required. Specifies the function to be executed when the request starts. Additional parameters:
|
Detailed description
XMLHttpRequest object and settings passed as parameters to the callback function.