jQuery Deferred Methods

Beginner
8 min read
Updated: Nov 2026
22 method guides
Method index

About This Index

This page is the jQuery Deferred index for the tutorial track. Each row links to a full guide with syntax, examples, and FAQs.

Learn the jQuery overview on /jquery. Use this page when you need a Deferred API such as $.Deferred(), deferred.done(), or deferred.then().

Beginner path.

Start with $.Deferred(), then done(), fail(), and promise()—learn then() and resolve()/reject() next.

How to Call a Deferred Method

Create a Deferred, attach handlers, settle it, and share a read-only promise:

jQuery
var dfd = $.Deferred();

dfd.done(function (value) {
  console.log("ok:", value);
}).fail(function (err) {
  console.error("fail:", err);
}).always(function () {
  console.log("cleanup");
});

dfd.resolve("ready");                 // or dfd.reject("oops")
dfd.state();                           // "resolved"

var p = dfd.promise();                // read-only for callers
$.ajax("/api/data").then(function (data) {
  return data.items;
});

jQuery Deferred Methods Table

All Deferred method guides in this jQuery tutorial series (22 tutorials).

Getting Started

5 methods

Create Deferreds and attach the core success/failure listeners.

MethodDescriptionTutorial
$.Deferred()Create a Deferred for custom async workflows — register handlers, then resolve or reject.Try it
$.when()Combine Deferreds, promises, or values into one promise — resolves when all resolve, rejects on first failure.Try it
deferred.done()Run a callback when the Deferred resolves successfully.Try it
deferred.fail()Run a callback when the Deferred is rejected.Try it
deferred.promise()Return a read-only promise so callers cannot resolve or reject.Try it

Handlers & Chaining

5 methods

Register callbacks, chain transforms, and handle errors in pipelines.

MethodDescriptionTutorial
deferred.always()Run a callback after resolve or reject — ideal for cleanup.Try it
deferred.catch()Handle rejection at the end of a promise chain (like Promise.catch).Try it
deferred.then()Chain success, failure, and progress handlers — return values flow to the next step.Try it
deferred.pipe()Legacy filter/chain API — deprecated in jQuery 3+; use then() instead.Try it
deferred.progress()Listen for interim progress updates from notify() or notifyWith().Try it

Progress

2 methods

Report interim status before final resolve or reject.

MethodDescriptionTutorial
deferred.notify()Send a progress update while the Deferred is still pending.Try it
deferred.notifyWith()Send progress with a custom this context and argument array.Try it

State & Settlement

7 methods

Resolve, reject, inspect status, and bind context with With-methods.

MethodDescriptionTutorial
deferred.resolve()Settle as successful and pass results to done() handlers.Try it
deferred.resolveWith()Resolve with a custom this context and arguments in an array.Try it
deferred.reject()Settle as failed and pass reasons to fail() handlers.Try it
deferred.rejectWith()Reject with a custom this context and arguments in an array.Try it
deferred.state()Return "pending", "resolved", or "rejected" — preferred status check in jQuery 3+.Try it
deferred.isResolved()Return true if resolved — deprecated; prefer state().Try it
deferred.isRejected()Return true if rejected — deprecated; prefer state().Try it

Diagnostics & Hooks

3 methods

Advanced hooks for logging exceptions and capturing async stacks in Deferred chains.

MethodDescriptionTutorial
Deferred.exceptionHook()Hook called when a then() callback throws — logs a console warning by default; override for reporting.Try it
Deferred.getErrorHook()Optional hook returning an Error so exceptionHook can show where an async then() was set up.Try it
Deferred.getStackHook()Deprecated older name of getErrorHook — use getErrorHook in jQuery 3.7+.Try it

Frequently Asked Questions

A Deferred represents an asynchronous task. Register callbacks with done(), fail(), always(), or then(), then settle later with resolve() or reject(). It powers $.ajax() and custom async APIs.
A Deferred is read-write—you can resolve, reject, and notify. promise() returns a read-only Promise listeners can observe but cannot settle. Keep the Deferred private; share the promise.
done() and fail() are clear for simple handlers. then() chains transforms and errors in one pipeline—prefer it for multi-step flows. always() is best for shared cleanup.
In jQuery 3+, call state() for "pending", "resolved", or "rejected". isResolved() and isRejected() still work but are deprecated.
Start with $.Deferred(), then done(), fail(), and promise(). Learn then() and resolve()/reject() next; add notify() when you need progress updates.

Start with $.Deferred()

Open the factory guide—syntax, examples, and FAQs.

$.Deferred() 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.

16 people found this page helpful