Tham khảo sách 'javascript bible_ chapter 39', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Advanced Event Handling Once an HTML page loads virtually nothing happens in the page without events. System and user actions make things happen especially if those events trigger JavaScript functions. Navigator 4 extends the event mechanism that has been in scriptable browsers since the beginning providing not only more events but also a more sophisticated way of trapping and responding to events. This chapter focuses on the details of this new mechanism to help you understand how and when to use it in your pages. A good deal of the imperative for implementing a deeper event mechanism came from Dynamic HTML. The possibility of hiding and showing any number of positionable elements on the screen each of which has its own complement of event-driven document elements is a great advantage to managing event handling across the application on a more global scale. The new event model is very good at helping with this. The Other Event Object In Chapter 33 you saw the basics of the event object. That was the event object with a lowercase e which is generated each time an event fires in response to some action. But an Event object with a capital E also exists. This object behaves like the Math object which is always around and has some handy properties and methods ready for our scripts to use at any time. The Event object provides a series of properties and no methods that event handling routines use as constants. The Event object s properties are divided into two groups. One group consists of four values representing modifier keys on the keyboard Alt Ctrl Shift Meta . The Meta key is the new Windows key on Windows computers it s the Command C key on the Mac. You may recall seeing these constants used to determine whether a mouse event was fired with one or more of those keys pressed at the same time as in the following In This Chapter The difference between the event and Event objects Capturing processing and redirecting events in Navigator Working with Navigator and .