jQuery Deferred notify() Method

Beginner
5 min read
Updated: Nov 2026
3 examples
Deferred

Definition

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.

Syntax

Start with these common calls. Keep them short and readable.

jQuery
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
CallWhat it does
DeferredMust still be pending
argsPassed to each progress callback
Return valueSame Deferred (chainable)

Load jQuery before your script (CDN or local file), then wrap DOM work in $(function () { ... }) when needed.

Parameters

ParameterDescription
Step 1Create a Deferred with $.Deferred().
Step 2Register .progress(function (value) { ... }) (and usually done / fail).
Step 3While work runs, call notify(args) one or more times.

Return Value

Return ValueDescription
See examplesCheck the examples below for what this API returns in common cases.

jQuery Examples

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).

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.

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.

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: deferred.notifyWith() Method

Send progress with a custom this context and argument array.

deferred.notifyWith() Method tutorial →

CODETOFUN NEWS

Stay Ahead in Tech

Get the latest IT news, programming updates, and technology trends directly on your phone.

Your daily dose of tech, straight to your feed.

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