forked from jquery/api.jquery.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcallbacks.fired.xml
31 lines (27 loc) · 1000 Bytes
/
callbacks.fired.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?xml version="1.0"?>
<entry name="callbacks.fired" type="method" return="Boolean">
<title>callbacks.fired()</title>
<signature>
<added>1.7</added>
</signature>
<desc>Determine if the callbacks have already been called at least once.</desc>
<longdesc>
<h2 id="example-1">Example</h2>
<p>Use <code>callbacks.fired()</code> to determine if the callbacks in a list have been called at least once:</p>
<pre><code><![CDATA[// a sample logging function to be added to a callbacks list
var foo = function( value ) {
console.log( "foo:" + value );
};
var callbacks = $.Callbacks();
// add the function "foo" to the list
callbacks.add( foo );
// fire the items on the list
callbacks.fire( "hello" ); // outputs: "foo: hello"
callbacks.fire( "world" ); // outputs: "foo: world"
// test to establish if the callbacks have been called
console.log( callbacks.fired() );
]]></code></pre>
</longdesc>
<category slug="callbacks-object"/>
<category slug="version/1.7"/>
</entry>