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
1 In Netscape, the event is passed as an argument to the handler as in WW_processclick(e)
2 While in Microsoft IE, event properties are stored in a single window property window.event
3 So in WW_eventx(e), the argument is ignored in IE
4 function WW_eventx(e) { // return x value of event
5 if(WW_Netscape4 ) {
6 return e.pageX; } // Netscape
7 else { return window.event.clientX; } // Microsoft
8 } // End WW_eventx(e)
9 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

in Table To:


© 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