• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 15. Working with the Mouse, Keyb... > Using the NS4 event Object

Using the NS4 event Object

In Netscape Navigator 4.0, you can capture and release events with methods such as captureEvents, disableExternalCapture, enableExternalCapture, handleEvent, releaseEvents, and routeEvent (see Chapter 6).

Here’s an example targeted to that browser that shows how to capture events. By default, when you click a button labeled Click Me! in this example, an alert box appears with the message Button saw the event. On the other hand, events in this browser start at the top of the object hierarchy and move downward; so if we capture the event in the document object with the captureEvent method, that event won’t get down to the button. You can do that by clicking the Enable Document Capture button; after you do and when you click the Click Me! button, all you’ll see is an alert box with the message Captured by the document.:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint