deferred.notifyWith(context [, args]) fires progress callbacks while pending (since jQuery 1.7), with this set to context and values taken from an optional args array.
Remember
dfd.progress(function (pct) {
// this === context
});
dfd.notifyWith(context, [40])
notify(40) // default this
notifyWith(ctx, [40]) // this === ctx; args as array
Pick a context object, pass progress values in an array, then settle when done.
Create a Deferred and register .progress(fn).
Choose the object that should be this inside the handler.
Call notifyWith(context, [arg1, arg2, ...]) while pending.
Finish with resolve / resolveWith (or reject variants).
Piece
Required?
Role
context
Yes
Becomes this in progress callbacks
args
Optional
Array (or array-like) of callback arguments
Return value
—
Same Deferred (chainable)
Pseudocode
Pseudocode
function notifyWith(deferred, context, args):
if deferred is resolved or rejected:
return deferred
list = args or []
for each progressCallback (in order):
call progressCallback with this=context, params=list...
return deferred
Reference
Cheat Sheet
Keep these facts handy when binding progress to a context.
Topic
Detail
Syntax
deferred.notifyWith( context [, args ] )
Since
jQuery 1.7
args
Array / array-like (spread to callback)
vs notify
Sets this; args wrapped in an array
State change?
No — stays pending
After settle
Ignored
Family
Like resolveWith / rejectWith
Try it
Live Preview
Pick a scenario and see notifyWith() set this and pass args.
Browser demo of deferred.notifyWith() — same ideas as the examples below.
Result
panel: Upload
progress: 40%
Code
jQuery Examples
Short, copy-ready snippets. Open DevTools Console, or use Try It Yourself for a live editor.
Example 1 — Context and Percent
Pass a panel object as this and the percent in an array.
Write notifyWith(ctx, [a, b]), not notifyWith(ctx, a, b). Loose extra args are not the jQuery pattern.
this
Arrow functions ignore context
Arrow progress handlers do not get a new this. Use a normal function if you rely on notifyWith context.
settle
Does not finish the Deferred
Always resolve/reject (or *With) when work ends. Progress alone leaves listeners pending.
access
Keep notifyWith private
Only the Deferred creator should call it. Give consumers promise() to listen safely.
Compatibility
Browser Support
deferred.notifyWith() has shipped since jQuery 1.7 and works in all modern browsers with jQuery loaded. It pairs with progress() like notify(), with an added context.
✓ jQuery 1.7+
deferred.notifyWith()
Supported everywhere jQuery Deferred runs in the browser. Use it when progress handlers need a custom this.
100%Browser support
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
notifyWith()Excellent
Bottom line: Call dfd.notifyWith(ctx, [args]) while pending. Listen with progress(). After settle, calls are ignored.
Analysis
Performance Notes
Approach
Cost
Best for
notifyWith
O(k) handlers
Progress with bound this
notify
O(k)
Simple values, no context
Frequent DOM updates
UI cost
Throttle milestones
Context binding is cheap. Throttle progress UI the same way you would with notify().
Remember
Key Takeaways
Role: progress updates with a chosen this.
Args: pass an array — elements become parameters.
vs notify: use notifyWith when context matters.
Finish: still resolve/reject; late notifies are ignored.
One line:dfd.notifyWith(ctx, [args]) is progress with a custom this — same settle rules as notify().
Frequently Asked Questions
notifyWith(context, args) calls progress callbacks while the Deferred is pending. Inside each callback, this is set to context, and values from the args array are passed as separate parameters.
notify(a, b) passes arguments directly with default this. notifyWith(ctx, [a, b]) sets this to ctx and requires args as an array (or array-like) — same pattern as resolveWith and rejectWith.
Pass an array such as [40] or [step, total, label]. jQuery spreads those elements as individual arguments to each progress callback.
No. Like notify(), it only fires progress handlers. Call resolve(), resolveWith(), reject(), or rejectWith() when the work finishes.
Use it when progress handlers need a specific this — for example a UI widget or view model — especially inside timers where this would otherwise be lost.
Yes. After the Deferred is resolved or rejected, further notifyWith() calls are ignored, and late progress handlers do not receive past progress.