jQuery ajaxSend()Method
Examples
Change the content of the <div> element when an AJAX request is about to be sent:
$(document).ajaxSend(function(e,xhr,opt){
$("div").append("<p>Requesting: " + opt.url + "</p>");
});
Try it Yourself »
Definition and Usage
The ajaxSend() method specifies a function to run when an AJAX request is about to be sent.
Note:As of jQuery version 1.8, this method is only attached to the document.
Syntax
$(document).ajaxSend(function(event,xhr,options))
| Parameters | Description |
|---|---|
| function(event,xhr,options) | Required. Specifies the function to run when the request succeeds. Additional parameters:
|
Other Extensions
jQuery AJAX Methods