The promise() method returns a read-only view of a jQuery Deferred. Consumers can listen with then(), done(), or catch() — but cannot call resolve() or reject(). This tutorial covers syntax, encapsulation patterns, five examples, and comparisons with full Deferred objects.
01
Syntax
dfd.promise()
02
Read-only
No resolve/reject
03
Return
From async APIs
04
target
Optional object
05
vs Deferred
Hide control
06
Since 1.5
Core Deferred API
Fundamentals
Introduction
When you build an async helper — fetch user data, run a animation sequence, wrap a timer — you usually create a $.Deferred() internally. But returning the raw Deferred gives callers the power to call resolve() or reject() themselves, which breaks encapsulation.
promise() solves that. Return deferred.promise() instead: outsiders get a thenable they can observe, while only your module settles the real Deferred.
Concept
Understanding the promise() Method
promise() creates (or augments) a promise object linked to the same underlying state as the Deferred. It exposes listener methods — done, fail, always, then, catch, progress, and state — but omits settlement methods like resolve, reject, and notify.
This is the same pattern $.ajax() uses: the jqXHR object you chain .done() onto is promise-like, while jQuery internally controls when the request completes.
💡
Beginner Tip
The reference example correctly returns deferred.promise() from fetchData() and consumes it with then() / catch(). Always settle the internal Deferred inside your module — never expect callers to resolve it for you.
Foundation
📝 Syntax
General form of deferred.promise:
jQuery
deferred.promise( [ target ] )
Parameters
target (optional) — object onto which promise methods are copied. If omitted, jQuery returns a new plain object with those methods.
Return value
A promise object (or the target object) that reflects the Deferred’s state but cannot change it.
Internal code calls reject(); the promise surface lets callers use catch() just like the reference example.
Applications
🚀 Use Cases
Public async APIs — return promise() from module functions so callers cannot force settlement.
AJAX wrappers — mirror $.ajax() by exposing jqXHR-style promise objects.
Plugin interfaces — use promise(target) on a plugin instance for chainable async methods.
Shared resources — pass one promise to multiple components waiting on the same load.
Animation helpers — wrap .fadeOut() or custom timers and return a promise for sequencing.
🧠 How promise() Encapsulates Async Work
1
Create
Module creates private $.Deferred() and starts async work.
Internal
2
Expose
Return dfd.promise() — read-only handle for callers.
Public
3
Settle
Module calls resolve() or reject() when work finishes.
Owner
=
🔒
Safe boundary
Callers listen; only the owner controls the outcome.
Important
📝 Notes
Always return promise() from public APIs — keep the Deferred variable private.
Calling promise() multiple times on the same Deferred returns equivalent thenables tied to the same state.
jQuery 3+ promises support then() / catch() like native Promises.
promise() does not clone async work — it only restricts the interface.
For combining multiple promises, use $.when() with promise objects.
Compatibility
Browser Support
deferred.promise() has been available since jQuery 1.5 alongside the Deferred API. It works in jQuery 1.5+, 2.x, and 3.x.
✓ jQuery 1.5+
jQuery Deferred.promise()
Universal wherever jQuery Deferred runs. jQuery 3+ promise objects are Promises/A+ compatible via then().
100%With jQuery loaded
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
deferred.promise()Universal
Bottom line: Standard pattern for encapsulating jQuery async APIs since 1.5. $.ajax() jqXHR objects follow the same model.
Wrap Up
🎉 Conclusion
The deferred.promise() method exposes a read-only view of async work. Return it from your functions, settle the internal Deferred yourself, and let consumers chain then() or done() safely.
Next, explore reject() to see how Deferred owners signal failure — the counterpart to resolve().
Confuse promise() with creating a native Promise constructor
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about promise()
How to expose async results safely in jQuery.
5
Core concepts
📝01
Returns
Read-only thenable
API
🔒02
No settle
Listen only
Safe
📦03
target
Attach methods
Optional
🔗04
Share
Many listeners
Pattern
ajax05
jqXHR
Same idea
Real world
❓ Frequently Asked Questions
promise() returns a promise object tied to the same async outcome as the Deferred. Callers can attach done(), fail(), then(), or catch() — but they cannot call resolve(), reject(), or notify() on the returned object.
To encapsulate control. Only the code that created the Deferred should settle it. Returning promise() exposes status listeners without letting outside code force resolve or reject.
promise(target) copies promise methods (done, fail, then, etc.) onto an existing object and returns that object. Useful when a widget or API object should be both a DOM helper and thenable.
No. The read-only promise does not expose resolve, reject, or notify. Only the original Deferred owner can settle the operation.
Similar in purpose — both represent a future result — but jQuery's promise is thenable and supports done/fail/progress. jQuery 3+ Deferreds are Promises/A+ compatible via then().
Yes. jqXHR objects are promise-like and support .done(), .fail(), .always(), and .then(). Internally they use the same Deferred machinery as deferred.promise().
Did you know?
Before ES2015 native Promises, jQuery’s deferred.promise() was many developers’ first introduction to “return a thenable, keep settlement private.” The same encapsulation idea now appears in fetch, async/await, and the Promise constructor.