ajaxStop is a global AjaxEvent (since jQuery 1.0; .on() binding since 1.7). jQuery triggers it on document when the last qualifying Ajax request finishes and no others remain active. All registered handlers run.
Syntax
Start with these common calls. Keep them short and readable.
jQuery
$(document).on("ajaxStop", function () {
// runs when no global Ajax requests remain active
});
// Batch lifecycle:
// ajaxStart (first begins) → …requests… → ajaxStop (last ends)
// Opt out for one call:
$.ajax({ url: "/x", global: false });
Call
What it does
document
Only valid bind target for global Ajax events
handler
function() — no extra arguments
ajaxStart
Show loading UI when the first request begins
global: false
Skip all global Ajax events for that call
Load jQuery before your script (CDN or local file), then wrap DOM work in $(function () { ... }) when needed.
Parameters
Parameter
Description
Step 1
Attach the handler to document with .on("ajaxStop", handler).
Step 2
Pair with ajaxStart if you show a spinner when activity begins.
Step 3
Make requests with $.ajax(), $.get(), $.post(), or .load().
Return Value
Return Value
Description
jQuery object
Most setters and traversing helpers return the jQuery collection so you can chain more methods.
jQuery Examples
Example 1 — Document Handler + .load()
Official pattern: log a message when global Ajax activity ends after a click.
jQuery
$(document).on("ajaxStop", function () {
$(".log").text("Triggered ajaxStop handler.");
});
$(".trigger").on("click", function () {
$(".result").load("ajax/test.html");
});
Click #run-two → two parallel $.get()
stopCount increments by 1 (not 2)
ajaxComplete would fire twice
How It Works
Counter. jQuery tracks active global requests internally.
Overlap. The second call keeps the count above zero.
Idle. When both finish, the count hits zero → one ajaxStop.
Frequently Asked Questions
ajaxStop is a global AjaxEvent that fires when all qualifying jQuery Ajax requests have completed — when no global Ajax requests remain active. Bind it with $(document).on("ajaxStop", handler) (since 1.7).
Since jQuery 1.9, all global Ajax event handlers must be bound to document — not window or other elements. Use $(document).on("ajaxStop", fn) and remove with $(document).off("ajaxStop", fn).
ajaxComplete fires after every individual qualifying request finishes. ajaxStop fires once when the last active global request completes and the active count returns to zero. For three parallel calls: ajaxComplete runs three times; ajaxStop runs once.
No. It fires only when no global Ajax requests remain in progress. Pair it with ajaxStart, which fires once when the first request begins.
When $.ajax() or $.ajaxSetup() sets global: false, that request opts out of all global Ajax events. ajaxStop will not fire for it, and it does not count toward active global requests for ajaxStart/ajaxStop.
None beyond a normal function call — function() { ... }. Unlike ajaxComplete or ajaxSend, you do not receive jqXHR or settings. Use ajaxComplete when you need per-request details.
The shorthand method .ajaxStop(handler) is deprecated as of jQuery 3.5. Prefer $(document).on("ajaxStop", handler) — the event API this page teaches.