SafariEventTarget Class Reference
| Technology area | Safari Extensions |
| Availability | Available in Safari 5.0 and later. |
Overview
The SafariEventTarget class serves as a base class for all objects that participate in the event-dispatch hierarchy.
Methods
addEventListener
Starts listening for the specified type of event.
Parameters
- type
The type of event to listen for.
- listener
The function to call when the event occurs.
- useCapture
Pass
trueif you want to listen during the capturing phase; otherwise,false.
Discussion
For the string used to identify the type of an event, see the reference for the class used to represent that event.
Availability
- Available in Safari 5.0 and later.
removeEventListener
Stops listening for the specified type of event.
Parameters
- type
The type of event to listen for.
- listener
The function to call when the event occurs.
- useCapture
Pass
trueif you want to listen during the capturing phase; otherwise,false.
Discussion
For the listener to be removed, the parameters must be exactly the same as the parameters that were passed to addEventListener to add the listener.
Availability
- Available in Safari 5.0 and later.
© 2010 Apple Inc. All Rights Reserved. (Last updated: 2010-06-30)