Basic HTML version of Foils prepared 11 March 99

Foil 65 Event Processing Models

From Overview of JavaScript II -- From Cookies to Dynamical HTML CPS616 Technologies of the Information Age -- Spring Semester 99. by Geoffrey C. Fox (Tom Scavo)

DHTML Utilities and Second DHTML Example in html and text for Foil 65
In Netscape, the event is passed as an argument to the handler as in WW_processclick(e)
While in Microsoft IE, event properties are stored in a single window property window.event
So in WW_eventx(e), the argument is ignored in IE
function WW_eventx(e) { // return x value of event
if(WW_Netscape4 ) {
return e.pageX; } // Netscape
else { return window.event.clientX; } // Microsoft
} // End WW_eventx(e)
Also there is meant to be a different event handling model in browsers
  • In Microsoft IE, events are bubbled up through the containing objects until document is finally reached
  • In Netscape4, events are first processed by window and then passed down through container hierarchy. return false stops this sequence
  • For both browsers, if you put return false in WW_processclick(e), then clicking on link will NOT load new page



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Thu Mar 11 1999