Easy Tutorial
❮ Misc Deferred Rejectwith Sel Input Checked ❯

jQuery callbacks.disable() Method

jQuery Miscellaneous Methods

Example

Disable callbacks in the callback list.

$(function () { 
    // A simple function that will be added to the list
    var foo = function( value ) {
        alert( value );
    };
    var callbacks = $.Callbacks();     
    // Add the above function to the callback list
    callbacks.add( foo );     
    // Invoke all callbacks in the list with the argument "foo"
    callbacks.fire( "foo" );
    // Output: foo     
    // Disable the callback function
    callbacks.disable();     
    // Attempt to invoke with "foobar" as the argument
    callbacks.fire( "foobar" );
    // foobar will not be output
})

Definition and Usage

The callbacks.disable() function is used to disable callbacks in the callback list.

Note: This method returns the callback object to its bound callback list.


Syntax

This method does not accept any parameters.


jQuery Miscellaneous Methods

❮ Misc Deferred Rejectwith Sel Input Checked ❯