jQuery callbacks.fired() Method — Check If Fired

Beginner
4 min read
Updated: Oct 2026
4 examples
Live preview

What Is fired()?

callbacks.fired() returns a Boolean: true if fire() or fireWith() has run at least once on that list (since jQuery 1.7). It does not invoke handlers.

Remember
callbacks.fired()   // false before any fire
callbacks.fire("x")
callbacks.fired()   // true after

fire()  → run handlers (action)
fired() → boolean status (question)
NeedUse
Has the list been invoked?cbs.fired()
Invoke handlerscbs.fire(args…)
Is the list shut down?cbs.disabled()
Create the list$.Callbacks([flags])

How to Use fired()

Call it anytime you need a yes/no on whether the list has already published.

  1. Create a list and optionally add() handlers.
  2. Call fired() before any fire — expect false.
  3. Call fire() or fireWith() when ready.
  4. Call fired() again — expect true from then on.
PieceRequired?Role
Callbacks objectYesFrom $.Callbacks()
ArgumentsNonefired() takes no parameters
Return—Boolean — has the list fired?

Pseudocode

Pseudocode
function fired(callbacks):
    return callbacks.hasBeenInvokedAtLeastOnce

// After fire() or fireWith() succeeds:
//   hasBeenInvokedAtLeastOnce = true
// Later ignored fires (e.g. once) keep it true

Cheat Sheet

Keep these facts handy when checking Callbacks status.

TopicDetail
Syntaxcallbacks.fired()
SincejQuery 1.7
Returnstrue / false
Sets flagfire() / fireWith()
Does not fireRead-only check
Related statusdisabled(), locked()

Live Preview

Watch fired() flip from false to true after you fire the list.

Browser demo of callbacks.fired() — same idea as the examples below.

Result
fired() → false

jQuery Examples

Short, copy-ready snippets. Open DevTools Console, or use Try It Yourself for a live editor.

Example 1 — Check After fire()

Official style: fire the list, then call fired().

jQuery
var foo = function (value) {
  console.log("foo: " + value);
};

var callbacks = $.Callbacks();
callbacks.add(foo);
callbacks.fire("hello");
callbacks.fire("world");

console.log(callbacks.fired());  // true
Try It Yourself

How It Works

  1. Register foo with add().
  2. Fire twice — handlers run each time.
  3. Ask. fired() returns true because invocation happened.
  4. No args. You never pass anything to fired().

Example 2 — False Before Any Fire

A fresh list has not been invoked yet.

jQuery
var cbs = $.Callbacks();
cbs.add(function () { /* ... */ });

console.log(cbs.fired());  // false

cbs.fire();
console.log(cbs.fired());  // true
Try It Yourself

How It Works

  1. Create a list and optionally add handlers.
  2. Before fire. fired() is false.
  3. After fire. The same call returns true.
  4. Guard. Use this to skip a second init path.

Example 3 — Still True With once

Ignored second fires do not reset the flag.

jQuery
var cbs = $.Callbacks("once");
cbs.add(function (msg) { console.log(msg); });

cbs.fire("first");
console.log(cbs.fired());  // true

cbs.fire("second");        // ignored
console.log(cbs.fired());  // still true
Try It Yourself

How It Works

  1. once allows only the first fire() to run handlers.
  2. First fire sets the fired flag.
  3. Second fire is a no-op for handlers.
  4. Status. fired() stays true — “has ever fired,” not “will fire again.”

Example 4 — fireWith() Also Counts

Custom-context fires mark the list the same way.

jQuery
var cbs = $.Callbacks();
cbs.add(function (label) {
  console.log(this.id + ": " + label);
});

console.log(cbs.fired());  // false

cbs.fireWith({ id: "box" }, ["ready"]);
console.log(cbs.fired());  // true
Try It Yourself

How It Works

  1. Before. Status is false.
  2. fireWith. Runs handlers with a custom this.
  3. After. fired() becomes true.
  4. Same flag. Both fire and fireWith count as “invoked.”

Edge Cases & Pitfalls

Do not confuse status checks with actions.

action

fired() never runs handlers

Use fire() to publish. fired() only answers a yes/no question.

empty

Empty fire still counts

Calling fire() with no handlers still marks the list as fired.

disable

Not the same as disabled()

A list can be fired and still enabled, or disabled without ever firing. Check both when debugging.

args

Do not pass flags to fired()

Flags belong on $.Callbacks("once memory") at creation time.

Browser Support

callbacks.fired() has shipped since jQuery 1.7 with $.Callbacks. It works in all modern browsers with jQuery loaded.

✓ jQuery 1.7+

callbacks.fired()

Boolean status helper — true after fire() or fireWith() has run at least once.

100% Browser support
Google Chrome All versions · Desktop & Mobile
Full support
Mozilla Firefox All versions · Desktop & Mobile
Full support
Apple Safari All versions · macOS & iOS
Full support
Microsoft Edge All versions · Chromium & Legacy
Full support
Internet Explorer IE 6+ · Legacy environments
Full support
Opera All modern versions
Full support
callbacks.fired() Excellent

Bottom line: Call fired() with no arguments. Pair it with fire() for publish and disabled() / locked() for other statuses.

Performance Notes

ApproachCostBest for
fired()O(1)Status checks / guards
fire()O(n) handlersActually invoking the list
Own boolean flagO(1)Fine, but fired() is built-in

Reading fired() is cheap. Prefer it over maintaining a separate hasFired variable next to a Callbacks list.

Key Takeaways

  • Role: boolean — has this list been invoked?
  • Sets flag: fire() and fireWith().
  • Sticky: stays true even when later fires are ignored.
  • Not disable: use disabled() for shutdown status.

One line: fired() answers “has this Callbacks list been invoked at least once?” — it never runs the handlers itself.

Frequently Asked Questions

fired() returns true if fire() or fireWith() has been called on the list at least once; otherwise false. It is a status check only — it does not invoke handlers.
No. fired() accepts no arguments. Flags such as once or memory belong on $.Callbacks("…") when you create the list.
fire() is the action that runs handlers. fired() answers whether that action has happened at least once. It returns a boolean and does not change the list.
After the first successful fire() or fireWith(). It remains true even if later fires are ignored (for example with the once flag).
fired() tracks whether the list has been invoked. disabled() tracks whether disable() shut the list down. A list can be fired but not disabled, or disabled without ever firing.
Use it to skip duplicate init, assert teardown only after init ran, debug late subscribers (with memory), or write tests that verify fire() was called.

Next: disable()

Learn how to permanently shut down a Callbacks list.

disable() 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.

7 people found this page helpful