deferred.promise() returns a Promise for that Deferred (since jQuery 1.5). The Promise lets other code attach handlers or read state(), but it hides methods that change the outcome — resolve, reject, notify, and their *With forms.
Start the work; call resolve / reject / notify only there.
Return dfd.promise() (or dfd.promise(target)).
Callers attach then, done, fail, or progress — they cannot settle it.
Piece
Required?
Role
target
Optional
Object that receives promise methods; returned instead of a new Promise
Return
—
Promise (or the target with promise methods attached)
Since
—
jQuery 1.5
Pseudocode
Pseudocode
function asyncWork():
dfd = Deferred()
start timers / AJAX / tasks
on success: dfd.resolve(value)
on failure: dfd.reject(reason)
return dfd.promise() // callers listen only
caller:
asyncWork().done(onOk).fail(onErr)
// asyncWork().resolve(...) → not available
Reference
Cheat Sheet
Keep these facts handy when wrapping async APIs.
Topic
Detail
Syntax
deferred.promise([target])
Listeners
then, done, fail, always, progress
Inspect
state(), promise()
Hidden
resolve, reject, notify (+ *With)
target
Attach methods onto an existing object
vs Deferred
Same outcome; Promise cannot settle it
Since
jQuery 1.5
Try it
Live Preview
Compare a full Deferred with the Promise from promise().
Browser demo of deferred.promise — same idea as the examples below.
Result
Deferred has resolve: true
Promise has resolve: false
Promise has done: true
/* promise() hides settling methods */
Code
jQuery Examples
Short, copy-ready snippets. Open the browser console, or use Try It Yourself for a live editor.
Example 1 — Return promise() from a Helper
Create a Deferred inside the function; give callers only the Promise.
jQuery
function fetchData() {
var dfd = $.Deferred();
setTimeout(function () {
dfd.resolve({ data: "Sample data" });
}, 200);
return dfd.promise();
}
fetchData().done(function (response) {
console.log(response.data); // Sample data
});
Check these before returning Deferreds from public APIs.
leak
Do not return the Deferred
Returning dfd lets callers call resolve/reject/notify. Always return dfd.promise() from public helpers.
target
promise(target) mutates the object
Methods are attached onto target. Avoid accidental name clashes with existing properties like done or state.
pipe
pipe is still on the Promise
The Promise exposes deprecated pipe(). Prefer then() in new code.
native
Not identical to native Promise
jQuery Promises add done/fail/progress. jQuery 3+ then is Promises/A+-compatible, but the full API still differs from new Promise.
Compatibility
Browser Support
deferred.promise() needs jQuery 1.5+ loaded. It works across jQuery 1.5–3.x as the standard way to expose a read-only Deferred view.
✓ jQuery 1.5+
deferred.promise()
Works in Chrome, Firefox, Safari, and Edge when jQuery 1.5+ is loaded. Use it whenever you return async handles from helpers.
100%With jQuery 1.5+
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
promise()Universal
Bottom line: Safe for all jQuery versions that include Deferreds. Prefer returning promise() from every public async API.
Analysis
Performance Notes
Approach
Cost
Best for
dfd.promise()
Tiny wrapper
Public async APIs
Return raw dfd
Same runtime, worse safety
Avoid in shared code
promise(target)
Copies methods onto object
Widget / API objects that should be thenable
The cost of promise() is negligible next to timers or network work. Use it for API safety, not micro-optimization.
Remember
Key Takeaways
Role: expose a read-only view of a Deferred.
Pattern: keep Deferred private; return promise().
Hidden: no resolve / reject / notify on the Promise.
target:promise(obj) makes an existing object thenable.
One line: return deferred.promise() so callers can listen, not settle.
Frequently Asked Questions
promise() returns a Promise tied to the same outcome as the Deferred. Callers can use then, done, fail, always, progress, state, pipe, and promise — but not resolve, reject, notify, or the *With variants.
Encapsulation. Only the owner should settle the operation. Returning promise() lets other code attach handlers or inspect state without forcing resolve, reject, or notify.
promise(target) attaches promise methods onto an existing object and returns that object. Useful when an API object should also act as a thenable Promise.
No. The Promise does not expose resolve, reject, or notify. Only the original Deferred can settle the work.
Similar idea — a future result — but jQuery’s Promise also supports done/fail/progress. In jQuery 3+, then() follows Promises/A+ semantics.
No. Each promise() view observes the same Deferred. Settling the Deferred once settles every promise derived from it.