December 31, 2000 - The Netscape 6 Event Model | WebReference

December 31, 2000 - The Netscape 6 Event Model

Yehuda Shiran December 31, 2000
The Netscape 6 Event Model
Tips: December 2000

Yehuda Shiran, Ph.D.
Doc JavaScript

Netscape 6 has a unique event model. It combines the Navigator event model with that of the Internet Explorer. Events in Navigator propagates downwards from the browser window object to the target object. Any object in the hierarchy can capture the event before it reaches the target object. Events in Internet Explorer propagates in the opposite direction. They bubble from the target object towards the browser window object. Any object can process the event on its way up. Netscape 6 supports both directions. The event dives in from the browser window object to the target object and then bubbles back to the window object. You can specify whether you want to intercept the event during its dive (capture phase) or its ascend (bubbling phase).

Another advantage of Netscape 6 event model is the ability to specify more than one actions per an event type. Both Navigator and Internet Explorer support only one action per an event type. When you wanted to invoke the function buttonClicked() whenever the a button is clicked, you wrote its event handler as:

onClick = buttonClicked();
But what if you want to specify another function to invoke? That's where Netscape 6 kicks in.

Learn more about the event model in Netscape Navigator 4.x in Column 9, The Navigator Event Model. Learn more about the event model in Internet Explorer in Column 10, The Internet Explorer Event Model.