control-freak-ide/Control-Freak-Documentation/jQuery/docs/entries/callbacks.fireWith.json
plastic-hub-dev-node-saturn 538369cff7 latest
2021-05-12 18:35:18 +02:00

1 line
1.2 KiB
JSON

{"name":"callbacks.fireWith","type":"method","title":"callbacks.fireWith()","deprecated":null,"removed":null,"desc":"Call all callbacks in a list with the given context and arguments.","categories":["callbacks-object","version/1.7"],"entries":[{"return":"Callbacks","signatures":{"added":"1.7","argument":[{"desc":"A reference to the context in which the callbacks in the list should be fired.","name":"context","optional":"true"},{"desc":"An argument, or array of arguments, to pass to the callbacks in the list.","name":"args","optional":"true"}]},"examples":{"desc":"Use <code>callbacks.fireWith()</code> to fire a list of callbacks with a specific context and an array of arguments:","code":"\n// A sample logging function to be added to a callbacks list\nvar log = function( value1, value2 ) {\n console.log( \"Received: \" + value1 + \",\" + value2 );\n};\n\nvar callbacks = $.Callbacks();\n\n// Add the log method to the callbacks list\ncallbacks.add( log );\n\n// Fire the callbacks on the list using the context \"window\"\n// and an arguments array\n\ncallbacks.fireWith( window, [ \"foo\",\"bar\" ] );\n// Outputs: \"Received: foo, bar\"\n"},"longdesc":"\n <p>This method returns the Callbacks object onto which it is attached (<code>this</code>).</p>\n "}]}