Easy Tutorial
❮ Misc_Data Html Append ❯

jQuery callbacks.fired() Method

jQuery Miscellaneous Methods

Example

Determine if the callback has 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 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 if the callback list has been fired at least once
    alert( callbacks.fired() );
})

Definition and Usage

The callbacks.fired() function determines if the callback has been called at least once.


Syntax

This method does not accept any parameters.


jQuery Miscellaneous Methods

❮ Misc_Data Html Append ❯