jQuery ajaxSuccess() method
Example
Trigger an alert box when an AJAX request completes successfully:
$
(
document
)
.
ajaxSuccess
(
function
(
)
{
alert
(
"
AJAX request completed
"
)
;
}
)
;
Try it »
Definition and Usage
The ajaxSuccess() method specifies a function to run when an AJAX request completes successfully.
**Note:** As of jQuery version 1.8, this method is attached only to the document.
Syntax
$(document).ajaxSuccess(
function(event,xhr,options))
| Parameters | Description |
|---|---|
| function(event,xhr,options) | Required. Specifies the function to run if the request succeeds. |
额外的参数:
More examples
Use the options parameter
How to use the options parameter to restrict a function to AJAX requests for a specific file.
jQuery AJAX methods