spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / javascript / column11


The Cross-Browser Event Model

Developer News
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?

In Column 9 and Column 10 we discussed the event model in Netscape Navigator 4.0x and Microsoft Internet Explorer 4.0x. In this column we'll show you how to combine these models, so that you can write interactive cross-browser applications.

Internet Explorer 4.0x's event model is based on event bubbling. An event is initially directed to its intended target (the element that generated the event), and then bubbles up the object hierarchy until an event handler captures the event and returns a false value (or sets the cancelBubble property to true).

In Navigator 4.0x an event is first sent to the top of the object hierarchy, the window object. It then travels down the tree, until an event handler captures it. You must explicitly instruct the event to continue its journey (by invoking the routeEvent() or handleEvent() functions) once it is caught by an event handler.

In this column we'll discuss many other differences between the two event models, and we'll show you how to overcome them. You'll learn:

  1. How to avoid elements that do not support the same event handler in both browsers.
  2. How to capture events at a high level.
  3. How to access the event object from within the event processing function.
  4. How to utilize the event object's properties.
  5. How to detect modifier keys.
  6. How to find out what key or mouse button the user pressed.

More Resources from Doc JavaScript
Columns Popular Columns Tips Tools
Latest Columns
41-50 | 31-40 | 21-30
11-20 | 1-10
Working with Windows
JavaScript and Frames
Bookmarklets
Random Tips
Personalized Tips
RSS Channels
Menu Builder
Rollover Builder
Rotation Builder
Reference Tip Categories (want one?)
Links
For Your Site
Did you learn something? Do you like this site? Please link to us!

http://www.internet.com

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage · Working with Ajax Server Extensions
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Wi-Fi Product Watch, November 2009 · Chip Market Recovering From '08 Collapse · Low-Cost Tools to Kickstart Your New Business


Created: January 13, 1998
Revised: January 13, 1998

URL: http://www.webreference.com/js/column11/