ajaxStart is a global AjaxEvent (event since jQuery 1.0; .on() binding since 1.7). jQuery triggers it on document when the first qualifying Ajax request is about to begin — and only if no other global requests are already active.
Remember
$(document).on("ajaxStart", function () {
// runs when the first global Ajax request begins
});
// Order (batch):
// ajaxStart → ajaxSend → success|error → ajaxComplete → ajaxStop
// Opt out for one call:
$.ajax({ url: "/x", global: false });
Bind once on document, then the first global Ajax call can show your loading UI.
Attach the handler to document with .on("ajaxStart", handler).
Make requests with $.ajax(), $.get(), $.post(), or .load().
Show a spinner or status text inside the handler (no jqXHR args).
Pair with ajaxStop to hide the UI when the last request finishes.
Use global: false on requests that must stay silent.
Piece
Required?
Role
document
Yes (1.9+)
Only valid bind target for global Ajax events
handler
Yes
function() — no request args
ajaxStop
Recommended
Hide loading when no global requests remain
global: false
Optional
Skip all global Ajax events for that call
Pseudocode
Pseudocode
bind ajaxStart on document with handler()
when a jQuery Ajax request is about to send:
if request.global === false:
do not count it / do not fire ajaxStart
return
if no other global Ajax requests are active:
fire ajaxStart
for each registered handler:
call handler()
then fire ajaxSend for this request
... send and complete ...
when last active global request finishes:
fire ajaxStop
Reference
Cheat Sheet
Keep these facts handy while wiring a global loading indicator.
Topic
Detail
Bind
$(document).on("ajaxStart", handler)
Unbind
$(document).off("ajaxStart" [, handler])
Signature
function() — no jqXHR / settings
When
First global request begins (idle → busy)
Since
Event 1.0 · .on() form 1.7 · document-only 1.9+
Pair with
ajaxStop to hide loading UI
vs ajaxSend
Start = once per batch · Send = every request
Opt out
global: false in $.ajax() / $.ajaxSetup()
Try it
Live Preview
Run a real $.get() and watch the global ajaxStart handler update the log.
Live demo uses a public JSON API. Needs network access.
Result
Ready — pick an action and click Run.
Code
jQuery Examples
Short, copy-ready snippets. Open DevTools Console, or use Try It Yourself for a live editor.
Example 1 — Document Handler + .load()
Official pattern: log a message when the first Ajax request begins after a click.
jQuery
$(document).on("ajaxStart", function () {
$(".log").text("Triggered ajaxStart handler.");
});
$(".trigger").on("click", function () {
$(".result").load("ajax/test.html");
});
Click #go → Loading… appears
Request finishes → Loading… clears
#out shows the post title
How It Works
Start. First global request → show the loading message.
Work. The request runs; parallel calls keep the spinner text visible.
Stop. Last global request finishes → ajaxStop clears it.
Result. One spinner covers the whole active batch.
Edge Cases & Pitfalls
Check these before relying on a global loading spinner.
target
Bind on document only (1.9+)
Handlers on window or other elements will not receive global Ajax events.
once
Not per request
ajaxStart fires once per busy batch. Use ajaxSend when you need every request.
global
global: false stays silent
Those requests never trigger ajaxStart and do not count toward the active total.
args
No jqXHR in the handler
Unlike ajaxSend / ajaxComplete, the start handler has no settings object — keep it for UI only.
Compatibility
Browser Support
ajaxStart has been part of jQuery since 1.0. Prefer $(document).on("ajaxStart", …) (1.7+). Since 1.9, handlers must attach to document.
✓ Stable · jQuery 1.0+
jQuery ajaxStart
Works in every browser that runs your loaded jQuery version. Prefer a current jQuery 3.x build for modern projects.
100%jQuery Ajax event
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
Internet ExplorerIE 6+ · Legacy environments
Full support
OperaAll modern versions
Full support
ajaxStartUniversal
Bottom line: Safe for everyday apps. Bind on document, pair with ajaxStop for loading UI, and use global: false for silent background calls.
Analysis
Performance Notes
Approach
Cost
Best for
One ajaxStart + ajaxStop
Cheap
Page-wide loading spinner
ajaxSend every request
Cheap
Per-request logging / headers
Heavy DOM work on every start
Expensive
Avoid — keep the handler tiny
Global start handlers are fine when they only toggle a spinner or short status text. Leave per-request work to ajaxSend or beforeSend.
Remember
Key Takeaways
Role: global “Ajax just became busy” hook — first request only.
Bind:$(document).on("ajaxStart", fn) — document only since 1.9.
Pair: use ajaxStop to hide the same loading UI.
Per request: prefer ajaxSend when you need settings or jqXHR.
One line:ajaxStart is jQuery’s global first-request-began event — bind it on document and pair it with ajaxStop.
Frequently Asked Questions
ajaxStart is a global AjaxEvent that fires when the first qualifying jQuery Ajax request is about to be sent — and only when no other global Ajax requests are already in progress. Bind it with $(document).on("ajaxStart", 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("ajaxStart", fn) and remove with $(document).off("ajaxStart", fn).
No. It fires once when the first active global request begins. Three parallel $.ajax() calls still trigger ajaxStart only once. Pair it with ajaxStop, which fires when the last active global request finishes.
ajaxStart fires once at the start of a batch (no active requests yet). ajaxSend fires before every individual qualifying request and receives event, jqXHR, and settings. Use ajaxStart for page-wide loading UI; use ajaxSend for per-request work.
When $.ajax() or $.ajaxSetup() sets global: false, that request opts out of all global Ajax events. ajaxStart will not fire for it, and it does not count toward the active global request total used by ajaxStart/ajaxStop.
None that matter for typical use — function() { … }. Unlike ajaxSend or ajaxComplete, you do not get jqXHR or settings. Use those events when you need per-request details.
The shorthand method .ajaxStart(handler) is deprecated as of jQuery 3.5. Prefer $(document).on("ajaxStart", handler) — the event API this page teaches.