Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

jQuery callbacks.fired() method

jQuery callbacks.fired() method

jQuery Miscellaneous MethodsjQuery Miscellaneous Methods

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 MethodsjQuery Miscellaneous Methods