{"name":"callbacks.empty","type":"method","title":"callbacks.empty()","deprecated":null,"removed":null,"desc":"Remove all of the callbacks from a list.","categories":["callbacks-object","version/1.7"],"entries":[{"return":"Callbacks","signatures":{"added":"1.7"},"examples":{"desc":"Use callbacks.empty() to empty a list of callbacks:","code":"\n// A sample logging function to be added to a callbacks list\nvar foo = function( value1, value2 ) {\n console.log( \"foo: \" + value1 + \",\" + value2 );\n};\n\n// Another function to also be added to the list\nvar bar = function( value1, value2 ) {\n console.log( \"bar: \" + value1 + \",\" + value2 );\n};\n\nvar callbacks = $.Callbacks();\n\n// Add the two functions\ncallbacks.add( foo );\ncallbacks.add( bar );\n\n// Empty the callbacks list\ncallbacks.empty();\n\n// Check to ensure all callbacks have been removed\nconsole.log( callbacks.has( foo ) );\n// false\nconsole.log( callbacks.has( bar ) );\n// false\n"},"longdesc":"\n

This method returns the Callbacks object onto which it is attached (this).

\n "}]}