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

6.1. Basic Events

Events have been scriptable since the earliest scriptable browsers. The number and granularity of events have risen with the added scriptability of each browser generation. The HTML 4.0 recommendation cites a group of events it calls "intrinsic events," which all Version 4 browsers have in common (many of them dating back to the time of Navigator 2). These include onClick, onMouseOver, onKeyPress, and onLoad events, as well as many other common events. But beyond this list, there are a number of events that are browser specific and support the idiosyncrasies of the document object models implemented in Navigator 4 and Internet Explorer 4. Eventually (no pun intended), standards for events will be maintained by the formal DOM specification, but the subject is a complex one and appears to have been tabled until DOM Level 2.

Every event has a name, but the actual nomenclature you use in your scripts is more complicated. For example, when a user clicks a mouse button, the physical action fires a "click" event. But, as you will see in various tag attributes and script statements, the way you direct a clicked object to actually do something in response to the event is to assign the object an event handler that corresponds to the event. An event handler adopts the event name and appends the word "on" in front of it. Thus, the click event becomes the onClick event handler.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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