jQuery Deferred notify() Method

Beginner
6 min read
Updated: Oct 2026
4 examples
Live preview

What Is notify()?

deferred.notify(args) fires progress callbacks while the Deferred is still pending (since jQuery 1.7). It does not resolve or reject — use it for percent done, step labels, or status text.

Remember
dfd.progress(fn)
dfd.notify(25)     // fn(25) — still pending
dfd.notify(50)     // fn(50)
dfd.resolve("ok")  // done handlers; notify stops working

after settle → notify() ignored
NeedUse
Send progressdfd.notify(value)
Listen for progressdfd.progress(fn)
Finish successdfd.resolve(result)

How to Use notify()

Attach progress first, call notify during work, then settle.

  1. Create a Deferred with $.Deferred().
  2. Register .progress(function (value) { ... }) (and usually done / fail).
  3. While work runs, call notify(args) one or more times.
  4. When finished, resolve or reject — further notify calls are ignored.
PieceRequired?Role
DeferredYesMust still be pending
argsOptionalPassed to each progress callback
Return value—Same Deferred (chainable)

Pseudocode

Pseudocode
function notify(deferred, args...):
    if deferred is resolved or rejected:
        return deferred          // ignore
    for each progressCallback (in order):
        progressCallback(args...)
    return deferred

Cheat Sheet

Keep these facts handy while wiring progress updates.

TopicDetail
Syntaxdeferred.notify( [args] )
SincejQuery 1.7
Listenerprogress(fn) or then progress filter
State change?No — stays pending
Multiple callsYes, while pending
After settleIgnored (no throw)
ReturnsThe Deferred (chainable)

Live Preview

Pick a scenario and watch notify() feed progress().

Browser demo of deferred.notify() — same ideas as the examples below.

Result
progress: 40%

jQuery Examples

Short, copy-ready snippets. Open DevTools Console, or use Try It Yourself for a live editor.

Example 1 — Single Progress Update

Attach progress(), then call notify() once.

jQuery
var dfd = $.Deferred();

dfd.progress(function (pct) {
  console.log("progress: " + pct + "%");
});

dfd.notify(40);
// progress: 40%
Try It Yourself

How It Works

  1. Create a pending Deferred.
  2. Register a progress handler with progress(fn).
  3. Notify with 40 — jQuery calls fn(40).
  4. State stays pending until you resolve or reject.

Example 2 — Multiple Progress Updates

Call notify() several times while work is still running.

jQuery
var dfd = $.Deferred();
var lines = [];

dfd.progress(function (pct) {
  lines.push(pct + "%");
});

dfd.notify(25);
dfd.notify(50);
dfd.notify(75);

console.log(lines.join(" → "));
// 25% → 50% → 75%
Try It Yourself

How It Works

  1. One listener handles every progress event.
  2. Each notify invokes the callback with a new percent.
  3. Order matches call order: 25, then 50, then 75.
  4. Use case: uploads, multi-step jobs, long loops.

Example 3 — Progress Then Resolve

Typical full flow: progress updates, then success.

jQuery
var dfd = $.Deferred();
var lines = [];

dfd
  .progress(function (pct) {
    lines.push("progress: " + pct + "%");
  })
  .done(function (msg) {
    lines.push("done: " + msg);
  });

dfd.notify(50);
dfd.resolve("complete");

console.log(lines.join("\\n"));
// progress: 50%
// done: complete
Try It Yourself

How It Works

  1. Chain progress and done on the same Deferred.
  2. Notify reports interim status (still pending).
  3. Resolve finishes the job and runs the done handler.
  4. Separation: progress ≠ completion.

Example 4 — Notify After Settle Is Ignored

Once resolved, further notify() calls do nothing.

jQuery
var dfd = $.Deferred();
var lines = [];

dfd.progress(function (pct) {
  lines.push("progress: " + pct);
});

dfd.resolve("ok");
dfd.notify(99);   // ignored

console.log(lines.length === 0 ? "no progress after resolve" : lines.join("\\n"));
// no progress after resolve
Try It Yourself

How It Works

  1. Resolve first — Deferred leaves the pending state.
  2. Notify after — API ignores it (no error thrown).
  3. Handler never runs for that late update.
  4. Rule: send all progress before settle.

Edge Cases & Pitfalls

Check these before relying on progress updates.

settle

Notify does not finish the job

Always resolve or reject when work ends. Leaving a Deferred pending forever leaks handlers.

order

Progress after settle is dropped

Any notify() after resolve/reject is ignored. New progress handlers added after settle also never fire for past notifies.

api

Not on native Promises

Progress is jQuery-specific. Native Promise has no notify — plan a different progress channel outside jQuery.

access

Expose promise(), not the Deferred

Consumers should listen only. Keep notify / resolve on the private Deferred.

Browser Support

deferred.notify() has shipped since jQuery 1.7 and works in all modern browsers with jQuery loaded. It is part of the Deferred progress API (paired with progress()).

✓ jQuery 1.7+

deferred.notify()

Supported everywhere jQuery Deferred runs in the browser. Use it for interim progress while pending.

100% Browser support
Google Chrome All versions · Desktop & Mobile
Full support
Mozilla Firefox All versions · Desktop & Mobile
Full support
Apple Safari All versions · macOS & iOS
Full support
Microsoft Edge All versions · Chromium & Legacy
Full support
Internet Explorer IE 6+ · Legacy environments
Full support
Opera All modern versions
Full support
notify() Excellent

Bottom line: Call dfd.notify(args) while pending. Listen with progress(). After settle, notifies are ignored.

Performance Notes

ApproachCostBest for
notify occasionallyO(k) handlersUI percent / steps
Notify every loop tickCan flood UIThrottle (e.g. every 5%)
resolve onlyO(k)No interim feedback needed

Progress callbacks are cheap, but updating the DOM on every tiny tick can jank. Throttle notifies to meaningful milestones.

Key Takeaways

  • Role: interim progress while the Deferred is pending.
  • Listen: progress(fn) receives each notify.
  • Finish: still call resolve or reject.
  • After settle: further notify() calls are ignored.

One line: dfd.notify(args) updates progress without finishing — pair with progress(), then resolve/reject.

Frequently Asked Questions

notify(args) calls progress callbacks while the Deferred is still pending. It does not finish the Deferred — you still call resolve() or reject() when the work completes.
resolve() settles success and runs done(). notify() only fires progress() (or then progress handlers) and leaves state as pending until resolve or reject.
Register with deferred.progress(fn), or the progress slot of then(). Each notify() passes its args to those callbacks in registration order.
Yes. While pending, you can notify many times (for example 25%, 50%, 75%). After resolve or reject, further notify() calls are ignored.
Usually no. Only the Deferred creator should notify. Give callers a restricted promise via deferred.promise() so they can listen but not change state.
No. Progress is a jQuery Deferred feature. Native Promises only fulfill or reject; use callbacks, events, or other patterns for progress outside jQuery.

Next: notifyWith()

Send progress with a custom this context and argument array.

notifyWith() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

9 people found this page helpful