Q:

Remove a single callback or a set of callbacks from a callback list using jquery

0

Remove a single callback or a set of callbacks from a callback list  using jquery

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

HTML Code :

<!DOCTYPE html>
  <html>
  <head>
  <script src="https://code.jquery.com/jquery-git.js"></script>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>Remove a single callback or a set of  callbacks from a callback list.</title>
  </head>
  <body>
</body>
</html>

JavaScript Code :

// A sample function f1 
var foo = function( value ) {
  console.log( "foo: " + value );
};
 
var callbacks = $.Callbacks();
 
// Add f1 to the callback list
callbacks.add( foo );
 
// Fire the items on the list, passing an argument
callbacks.fire( "JavaScript" );
 
// Lock the callbacks list
callbacks.lock();
 
// Test the lock-state of the list
console.log ( callbacks.locked() );
// true

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now