The pipe() method filters and transforms values in a jQuery Deferred chain. Return a new value or another promise from doneFilter to pass results to the next step. This tutorial covers syntax, five examples, comparisons with done() and then(), and why pipe() is deprecated in jQuery 3+.
01
Syntax
pipe(done, fail, prog)
02
doneFilter
Transform success
03
Return value
Feeds next link
04
New promise
Chain async steps
05
vs then()
Modern replacement
06
Since 1.7
Deprecated in 3.0
Fundamentals
Introduction
Async workflows often need more than a single callback. After one task finishes, you may transform its result, start another request, or map errors before the UI updates. jQuery’s pipe() method builds that pipeline — each filter function receives the previous outcome and returns what the next link should receive.
In jQuery 3+, then() replaces pipe() with Promises/A+-compatible behavior. Understanding pipe() still helps when reading legacy code and when migrating chains to then().
Concept
Understanding the pipe() Method
pipe() returns a new promise-like object wired to filter callbacks. When the source Deferred resolves, jQuery calls doneFilter with the resolved values. Whatever the filter returns — a plain value, a new Deferred, or a thrown error — determines how the piped chain continues.
Optional failFilter handles rejections; optional progressFilter handles notify() progress events. Unlike done(), which ignores return values, pipe() is designed for value transformation.
💡
Beginner Tip
The reference AJAX examples use placeholder URLs like example.com/data — they illustrate chaining shape, not runnable endpoints. Our examples use $.Deferred() simulations you can run in Try-it labs without a server.
Returning a promise from pipe() pauses the chain until that promise resolves — the same pattern as chained AJAX calls in the reference, without needing real URLs.
📈 Practical Patterns
Nested Deferreds, error filters, and migration to then().
Example 3 — Parse and Enrich Data
Transform raw input, then return another Deferred for a follow-up step.
For new code, replace .pipe(fn) with .then(fn). Replace .pipe(null, failFn) with .then(null, failFn) or .catch(failFn).
Applications
🚀 Use Cases
Sequential AJAX — load an ID, then fetch details based on that ID in one chain.
Data transformation — parse JSON, normalize fields, or compute derived values between steps.
Conditional branching — return different promises from a filter based on intermediate results.
Error recovery — map failures to fallback values with failFilter.
Legacy maintenance — read and gradually migrate existing pipe() chains to then().
🧠 How a pipe() Chain Flows
1
Resolve
Source Deferred settles with a value (or rejects).
Input
2
Filter
doneFilter or failFilter runs and returns the next value or promise.
Transform
3
Continue
Piped promise forwards the result to the next pipe(), then(), or done().
Chain
=
🔗
Composed workflow
Multiple async steps behave like one pipeline — prefer then() in jQuery 3+.
Important
📝 Notes
pipe() is deprecated since jQuery 3.0 — use then() for new code.
Returning a value from done() does not affect the chain; use pipe() or then() for transforms.
Throwing inside a filter rejects the piped chain — same as returning a rejected promise.
Pass jQuery.noop or null to skip a filter slot when you only need fail or progress handling.
Always add fail() or catch() at the end of chains for user-facing error handling.
Compatibility
Browser Support
deferred.pipe() has been available since jQuery 1.7. It remains in jQuery 3.x but is deprecated — prefer then().
✓ jQuery 1.7+
jQuery Deferred.pipe()
Works in jQuery 1.7+, 2.x, and 3.x. Deprecated since 3.0 in favor of then() for Promises/A+ compatibility.
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.pipe()Universal
Bottom line: Safe in legacy jQuery code. For jQuery 3+ greenfield projects, write .then() instead of .pipe().
Wrap Up
🎉 Conclusion
The deferred.pipe() method transforms and chains asynchronous results through filter functions. It powered jQuery pipelines before Promises/A+ — today, then() is the recommended replacement.
Practice the five examples above, then continue to progress() to learn the listener side of progress reporting, or read the then() tutorial for modern chaining.
Chain real URLs without error handling (like bare example.com)
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about pipe()
Transform and chain jQuery Deferred values.
5
Core concepts
📝01
Filters
done / fail / prog
API
🔄02
Return
Next input
Transform
🔗03
Promise
Chain async
Sequence
⚠04
failFilter
Recover/map
Errors
then05
Modern
Use then()
jQ 3+
❓ Frequently Asked Questions
pipe() adds filter functions to a Deferred chain. On resolve, doneFilter receives the value and can return a transformed result or a new promise — the chain continues with that output. Optional failFilter and progressFilter handle rejection and progress paths.
Yes. pipe() is deprecated since jQuery 3.0 in favor of then(), which follows Promises/A+ semantics. pipe() still works in jQuery 3.x for legacy code; use then() in new projects.
done() only registers a side-effect callback — its return value is ignored. pipe() (and then()) use the filter's return value as the input for the next link in the chain.
A plain value (passed to the next step), another Deferred or promise (chain waits for it), or a rejected promise / thrown error (chain fails).
failFilter runs when the incoming Deferred rejects — useful for recovery or error mapping. progressFilter runs on notify() progress events and can transform progress values forwarded down the chain.
Prefer then(onFulfilled, onRejected) instead. It is the modern equivalent and matches native Promise chaining. Keep pipe() when maintaining older jQuery 1.x/2.x codebases.
Did you know?
jQuery added pipe() in 1.7 as a precursor to Promises/A+ chaining. When jQuery 3.0 aligned Deferreds with the Promise standard, then() became the official path forward and pipe() was marked deprecated — but millions of legacy plugins still call pipe() today.