Home  >  jQuery

Example of callbacks.disabled() in jQuery

March 29, 2013
callbacks.disabled() in jQuery disables the callback list. It accepts no arguments. It is called on callback list. It is called as
callbacks.disable();
 
Find the sample example.

<htmlgt
<body>

<script src="http://code.jquery.com/jquery-1.9.1.js"></script>

<script>
var show = function( val ) {
	console.log(val);
};
var callbacks = $.Callbacks();

callbacks.add( show );

callbacks.fire( "hello" );

callbacks.disable();

callbacks.fire( "World!" );

</script>
</body>
</html>
 
Output

Output in console will look like
Hello
 
FIND MORE TUTORILAS






©2019 concretepage.com | Privacy Policy | Contact Us