jQuery ajaxSend() method
Example
Change when an AJAX request is about to be sent
element's content changes:
event - Contains the event object
xhr - Contains the XMLHttpRequest object
options - Contains the options used in the AJAX request
|
$
(
document
)
.
ajaxSend
(
function
(
e
,
xhr
,
opt
)
{
$
(
"
div
"
)
.
append
(
"
Requesting:
"
opt
.
url
"
"
)
;
}
)
;
Try it »
Definition and Usage
The ajaxSend() method specifies a function to run just before an AJAX request is sent.
**Note:** As of jQuery version 1.8, this method is attached only 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. |
额外的参数:
jQuery AJAX methods