jQuery callbacks.fired()Method

jQuery 杂项方法jQuery Miscellaneous Methods

Example

Determine whether the callbacks have already been called at least once

$(function () { //A simple function that will be added to the list var foo = function( value ) { alert( "foo:" + value ); }; var callbacks = $.Callbacks(); //Add function "foo" to the list callbacks.add( foo ); //Call all callbacks in the list with the given argument callbacks.fire( "hello" ); //Output: "foo: hello" callbacks.fire( "world" ); //Output: "foo: world" //Test whether the callback list has been called only once alert( callbacks.fired() ); })

Try it Yourself »

Definition and Usage

The callbacks.fired() function determines whether the callbacks have already been called at least once.


Syntax

This method does not accept any parameters.

callbacks.fired()


jQuery 杂项方法jQuery Miscellaneous Methods

Other Extensions