874
edits
m (→Functions: rewording) |
m (→Observer Callbacks: minor formatting changes) |
||
| Line 153: | Line 153: | ||
==== Observer Callbacks ==== | ==== Observer Callbacks ==== | ||
Observer callbacks are of the following form: | Observer callbacks are functions of the following form: | ||
<pre class="brush:js;"> | |||
function callback(subject, data) { | |||
/* Respond to the event notification here... */ | |||
} | |||
</pre> | |||
In the above example, <tt>subject</tt> is any JavaScript object, as is <tt>data</tt>. The particulars of what the two contain are specific to the notification topic. | In the above example, <tt>subject</tt> is any JavaScript object, as is <tt>data</tt>. The particulars of what the two contain are specific to the notification topic. | ||
edits