jQuery ajaxStop() method
Example
Trigger an alert box when all AJAX requests have completed:
$
(
document
)
.
ajaxStop
(
function
(
)
{
alert
(
"
All AJAX requests have completed
"
)
;
}
)
;
Try it »
Definition and Usage
The ajaxStop() method specifies a function to run when all AJAX requests have completed.
When an AJAX request completes, jQuery checks whether there are more AJAX requests. If no other requests are pending, the ajaxStop() method runs the specified function.
**Note:** As of jQuery version 1.8, this method is attached only to the document.
Syntax
$(document).ajaxStop(
function())
| Parameters | Description |
|---|---|
| function() | Required. Specifies the function to run when all AJAX requests have completed. |
jQuery AJAX methods