June 30, 2000 - ViewLink's Event Routing | WebReference

June 30, 2000 - ViewLink's Event Routing

Yehuda Shiran June 30, 2000
ViewLink's Event Routing
Tips: June 2000

Yehuda Shiran, Ph.D.
Doc JavaScript

HTML Components are based on a primary document rendering an HTC file (also known as a document fragment, element behavior, XML namespace, etc). One immediate question that comes to mind is how events are communicated between the primary document and the HTC. One of the key features of IE 5.0's behaviors was the ability to use the fire() method to trigger an event passage to and from a behavior. IE 5.5's convention is different. For those events that bubbles up the document hierarchy, the browser automatically fires events to the primary document tree. Furthermore, the event is fired on the master element tag (the HTML Component's tag) and continues to bubble up the primary document tree. To all elements in the primary document tree, it appears as though this event originated at the master element tag.

As hinted above, bubbling events are fired across ViewLink components (primary document and document fragment), whereas nonbubbling events are not fired. Practically, most user events (mouse and keyboard) are fired.

For more on Behaviors, go to Column 22, Internet Explorer 5.0 Review, Part I and Column 23, Internet Explorer 5.0 Review, Part II. For more on events and event bubbling, go to Column 10, The Internet Explorer Event Model.