Method Summary
|
addEventListener
(
|
This method registers an event listener for a specific event. Multiple listeners can be added for the same event. Events are broadcast to all registered listeners. |
|
removeEventListener
(
|
This method removes an event listener for a specific event. |
Methods
This method registers an event listener for a specific event. Multiple listeners can be added for the same event. Events are broadcast to all registered listeners.
Parameters:
-
Name Type Description typenumber The event type of the event to subscribe to.
listenerToiEventListener The JavaScript function that will receive events.
Throws:
-
ToiInvalidArgumentException Raised if the event type is not supported by this object or if the listener is not a valid JavaScript function. This exception is also raised if the application calls addEventListener with the same combination of type and listener twice.
This method removes an event listener for a specific event.
Parameters:
-
Name Type Description typenumber The event type of the event to remove the listener from.
listenerToiEventListener The JavaScript function that was previously added as an event listener.
Throws:
-
ToiInvalidArgumentException Raised if the event type is not supported by this object or if the listener is not a valid JavaScript function. This exception is also raised if the listener has not previously been added.