jQuery Callbacks Methods

Beginner
7 min read
Updated: Nov 2026
12 method guides
Method index

About This Index

This page is the jQuery Callbacks 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 Callbacks API such as $.Callbacks(), callbacks.add(), or callbacks.fire().

Beginner path.

Start with $.Callbacks(), then add() and fire()—learn fireWith(), lock(), and disable() when you need context or lifecycle control.

How to Call a Callbacks Method

Create a list, register handlers, then fire them—optionally with flags like once and memory:

jQuery
var list = $.Callbacks("unique");

function greet(name) {
  console.log("Hello, " + name);
}

list.add(greet);
list.fire("Ada");           // Hello, Ada
list.has(greet);            // true
list.remove(greet);
list.empty();

var once = $.Callbacks("once memory");
once.add(function (msg) { console.log(msg); });
once.fire("ready");
once.add(function (msg) { console.log("late:", msg); }); // replays "ready"

jQuery Callbacks Methods Table

All Callbacks method guides in this jQuery tutorial series (12 tutorials).

Getting Started

3 methods

Create a Callbacks list, register handlers, and fire them.

MethodDescriptionTutorial
$.Callbacks()Create a managed callback list — optional once, memory, unique, and stopOnFalse flags.Try it
callbacks.add()Register one or more handler functions on the list.Try it
callbacks.fire()Invoke all handlers with optional arguments.Try it

List Management

3 methods

Unregister handlers, clear the list, and check membership.

MethodDescriptionTutorial
callbacks.remove()Unregister specific handler references from the list.Try it
callbacks.empty()Remove every handler from the list in one call.Try it
callbacks.has()Check whether a function is registered, or whether the list has any handlers.Try it

Invoke & Status

2 methods

Fire with a custom this context and check whether the list has fired.

MethodDescriptionTutorial
callbacks.fireWith()Invoke handlers with a custom this context and an arguments array.Try it
callbacks.fired()Return true if the list has been fired at least once.Try it

Control

4 methods

Lock the handler set, disable firing, and read status flags.

MethodDescriptionTutorial
callbacks.disable()Permanently shut down the list — fire() becomes a no-op.Try it
callbacks.disabled()Return true if disable() was called on the list.Try it
callbacks.lock()Freeze the list — add(), remove(), and empty() stop working.Try it
callbacks.locked()Return true if lock() was called on the list.Try it

Frequently Asked Questions

$.Callbacks() creates a managed list of functions. You add handlers with add(), invoke them with fire() or fireWith(), and control the list with lock(), disable(), and status checks like fired().
Callbacks is a lower-level list manager—you control add, fire, and flags directly. Deferred builds on Callbacks for async outcomes (resolve, reject, done, fail). Use Callbacks for pub/sub; use Deferred for promise-style flows.
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 set—no more add/remove, but fire() still works. disable() permanently stops firing. Lock to protect subscribers; disable to tear the list down.
Start with $.Callbacks(), then add() and fire(). Learn fireWith(), lock(), and disable() when you need context control or lifecycle rules.

Start with $.Callbacks()

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

$.Callbacks() tutorial →

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