Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

burst.web.WindowEvent Class Reference

List of all members.

Detailed Description

Scoping class to hold static functions related to window events.


Static Public Member Functions

Boolean addEventListener (Node node, String eventType, Function listener, Boolean useCapture, Boolean unsupported_ok)
 Calls native DOM addEventListener in W3-compliant environments.

void removeEventListener (Node node, String eventType, Function listener, Boolean useCapture)
 Calls native DOM removeEventListener in W3-compliant environments.

void addWindowListener (String eventtype, Function func, Window win)
 There are "DOM 0" events on the window object such as "load" and "resize".

void dispatchClick (Node node)
 Generates a 'click' event and dispatches it to the node.


Member Function Documentation

Boolean burst.web.WindowEvent.addEventListener Node  node,
String  eventType,
Function  listener,
Boolean  useCapture,
Boolean  unsupported_ok
[static]
 

Calls native DOM addEventListener in W3-compliant environments.

If on IE5/IE6, uses attachEvent().

Note that in general, window is not a Node (and Opera for example does not support window.addEventListener but does for real nodes). A window should not be passed to this function. See burst.web.WindowEvent.addWindowListener.

For IE, attachEvent handlers will be called after any handler registered via inline attribute (or dynamic expando). IE documentation says that if there are multiple handlers for the same node and event registered via attachEvent, they will be called in "random order".

Mozilla supports window.addEventListener.

ICE has window.addEventListener but not attachEvent.

void burst.web.WindowEvent.addWindowListener String  eventtype,
Function  func,
Window  win
[static]
 

There are "DOM 0" events on the window object such as "load" and "resize".

However, the W3 addEventListener function as specified only on a Node, not a window.

The potential events include: load unload resize abort error move Note that the body element might have any of these handlers. However, for a script executing in the "head" section of a page, typically document.body is null (document.documentElement exists though).

It will use window.addEventListner or window.attachEvent if they are available, but no standard mandates them. Otherwise it will set the window member (window.onload or window.onresize, etc.), combining with any existing binding (running after whatever exists).

Todo:
Will a dynamic window.onload always override a static or dynamic body.onload? See http://www.xs4all.nl/~ppk/js/events_events.html (no except Opera)

Can you attach handlers to document.documentElement?

removeWindowListener

Make has_window_event_listener return true for opera 7.5?

Parameters:
eventtype The name of the event ("load", "resize", etc.).
func The handler.
win Optional. defaults to window.

void burst.web.WindowEvent.dispatchClick Node  node  )  [static]
 

Generates a 'click' event and dispatches it to the node.

In W3-compliant environments, uses Document.createEvent, Event.initEvent, and Node.dispatchEvent

In IE it uses Document.createEventObject and Node.fireEvent

Otherwise it tries to call the Node.click method if any.

Todo:
How do dispatchEvent() and click() relate to addEventListener() and setting onclick()?

void burst.web.WindowEvent.removeEventListener Node  node,
String  eventType,
Function  listener,
Boolean  useCapture
[static]
 

Calls native DOM removeEventListener in W3-compliant environments.

If on IE5/IE6, uses detachEvent().


The documentation for this class was generated from the following file:
Generated on Tue Nov 30 04:03:09 2004 for BurstProject by doxygen 1.3.4