jQuery callbacks.empty () method
Examples
Remove all callbacks from the list
$ (Function () {
// Will be added to the list of simple functions
var foo = function ( value1, value2 ) {
alert ( "Foo:" + value1 + " ," + value2 );}
// Another function will be added to the list
var bar = function ( value1, value2 ) {
alert ( "Bar:" + value1 + " ," + value2 );}
var . callbacks = $ Callbacks (); // add two functions
callbacks. add ( foo );. Callbacks add ( bar ); // Clear the callback list
. callbacks empty (); // callback list to verify that all removed
alert ( callbacks. has ( foo ) ); // False
alert ( callbacks. has ( bar ) ); // False
})
try it"
Definition and Usage
callbacks.empty () function is used to delete all callbacks from the list.
This method returns a callback object to the callback list it binding.
grammar
This method does not accept any parameters.
callbacks.empty()