jQuery callbacks.fired() method
Example
Determine whether the callbacks have been called at least once
$
(
function
(
)
{
//
A simple function to be added to the list
var
foo
=
function
(
value
)
{
alert
(
"
foo:
"
value
)
;
}
;
var
callbacks
= $.
Callbacks
(
)
;
//
Add the function "foo" to the list
callbacks
.
add
(
foo
)
;
//
Call all callbacks in the list with the given arguments
callbacks
.
fire
(
"
hello
"
)
;
//
Output: "foo: hello"
callbacks
.
fire
(
"
world
"
)
;
//
Output: "foo: world"
//
Test whether the callback list has been called at least once
alert
(
callbacks
.
fired
(
)
)
;
}
)
Try it »
Definition and Usage
The callbacks.fired() function determines whether the callbacks have been called at least once.
Syntax
This method does not accept any parameters.
callbacks.fired()
jQuery Miscellaneous Methods