Need a lightweight pub/sub system or plugin hook list? jQuery Callbacks gives you a managed queue of functions — register with add(), trigger with fire(), and control lifecycle with flags and lock methods. This hub links to 12 Callbacks method tutorials.
01
$.Callbacks()
Create lists
02
add / remove
Subscribe
03
fire
Invoke
04
Flags
once memory
05
lock
Freeze list
06
12 guides
Full index
Fundamentals
Introduction
Multiple parts of your app may need to react to the same event — data loaded, plugin initialized, button clicked. Instead of one giant function, you maintain a list of handlers and run them together when something happens.
What Is the jQuery Callbacks Object?
$.Callbacks() is a factory that returns a callback list — an object with methods like add(), fire(), remove(), and lock(). It separates registration from invocation, keeping event wiring clean and testable.
💡
Beginner Tip
Think of Callbacks as a mailing list: add() subscribes addresses, fire() sends the newsletter, and remove() unsubscribes one recipient.
Key Features
List management — Add, remove, or clear handlers in a controlled queue.
Flexible invocation — Pass arguments with fire() or bind this with fireWith().
Behavior flags — Optional once, memory, unique, and stopOnFalse at creation time.
Lifecycle control — Freeze with lock(), shut down with disable(), and query status with fired(), locked(), disabled().
Init guards — Combine once and fired() for one-time setup.
Test doubles — Spy on whether handlers were added or lists fired.
Preview
👀 Callbacks vs Deferred
Callbacks manages lists; Deferred manages async outcomes built on those lists:
Callbacks → add(fn) + fire(data) → you control the queue directly Deferred → done(fn) + resolve(data) → built-in pending/resolved/rejected states $.ajax() → returns jqXHR (Deferred) → Callbacks power under the hood
Callbacks Method Tutorial Index
Search by method name or browse by category. Each tutorial includes syntax, five try-it examples, and FAQs.
Getting Started
3 tutorials
Create Callbacks lists, register handlers, and invoke them.
jQuery Callbacks ships with jQuery 1.7+ and works wherever jQuery runs. All 12 methods in this hub follow the same API across jQuery 1.x, 2.x, and 3.x.
✓ jQuery 1.7+
Callbacks API
Supported in all jQuery versions that include $.Callbacks(). Match your jQuery build to project requirements.
100%With jQuery
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
Callbacks methodsUniversal
Bottom line: Safe for jQuery-based apps. Prefer jQuery 3.7+ for new projects alongside modern native Promise APIs.
Wrap Up
🎉 Conclusion
jQuery Callbacks is a practical tool for managing groups of functions — from simple event buses to plugin hooks and Deferred internals. Start with $.Callbacks(), add(), and fire(), then explore flags and control methods as your needs grow.
Use the searchable index to open all 12 tutorials — each includes try-it labs and FAQs.
Fire before handlers are registered (unless using memory)
Confuse Callbacks with Deferred
Expect remove() with no args to clear all
Add duplicate handlers without unique flag
Memorize all 12 names at once
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about Callbacks
Your gateway to 12 method tutorials.
5
Core concepts
C01
$.Callbacks()
Create lists
Start
+02
add / remove
Subscribe
List
▶03
fire
Invoke
Run
🔒04
lock
Freeze
Control
1205
Index
Search all
Ref
❓ Frequently Asked Questions
$.Callbacks() creates a managed list of functions. You add handlers with add(), invoke them with fire() or fireWith(), and optionally freeze or shut down the list with lock() or disable(). It powers custom event buses and jQuery Deferred internally.
Callbacks is a lower-level list manager — you control add, fire, and flags directly. Deferred builds on Callbacks to represent async task outcomes with resolve, reject, done, and fail. Use Callbacks for pub/sub; use Deferred for promises-style async.
once lets fire() run handlers only the first time. memory stores the last fire arguments and replays them to handlers added later. Combine as $.Callbacks("once memory") for init-style hooks.
lock() freezes the handler list — no more add/remove, but fire() still works. disable() permanently stops firing. lock protects subscribers; disable tears down the list.
fire(arg1, arg2) passes variadic arguments with default this. fireWith(context, [args]) sets this inside handlers and takes an argument array. Use fireWith when handlers need a specific object as context.
Read the overview, try the five examples, then open add() or jQuery.Callbacks() from Getting Started. Use the search box to jump to any of the 12 method tutorials.
Did you know?
jQuery Deferred’s done(), fail(), and always() queues are Callbacks lists under the hood. Learning Callbacks first makes Deferred internals much easier to understand.