TAILIEUCHUNG - JavaScript Bible, Gold Edition part 90

JavaScript Bible, Gold Edition part 90. This book will bring programmers and non-technical professionals, including casual programmers and scripters, painlessly up to speed on all aspects of mastering JavaScript. Key topics include programming fundamentals, JavaScript language elements and how to use them effectively, and how to easily and efficiently add powerful new functionality to HTML documents and Java applets. | 738 Part III Document Objects Reference Listing 29-11 continued with either mouse button if you have more than one . P P Enter some text with uppercase and lowercase letters TEXTAREA COLS 40 ROWS 4 onKeyPress checkWhich event WRAP virtual TEXTAREA P FORM BODY HTML The codes displayed for the keyboard event are equivalent to the ASCII values of character keys. If you need the codes of other keys the onKeyDown and onKeyUp event handlers provide Unicode values for any key that you press on the keyboard. See the keyCode property listings for event objects later in this chapter for more details. Event Types Although browsers prior to Version 4 did not have an accessible event object this is a good time to summarize the evolution of what in today s browsers is known as the type property. The type property reveals the kind of event that generates an event object the event handler name minus the on . Object models in IE4 and NN6 provide event handlers for virtually every HTML element so that it s possible for example to define an onClick event handler for not only a clickable button but also a P or even an arbitrary SPAN element. We ll come back to the current crop of browsers in a moment. But first in case you must write scripts that work on older browsers you need to know which elements in those browsers support which event handlers. This knowledge will help you determine a common denominator of event handlers to implement in your pages based on the browsers you anticipate will be accessing the pages. Older browsers Earlier browsers tended to limit the number of event handlers for any particular element to just those that made sense for the kind of element it was. Even so many scripters wanted more event handlers on more objects. But until that became a reality in IE4 and NN6 authors had to know the limits of the object models. Table 29-3 shows the event handlers available for objects within three generations of early browsers. Each column represents the version in which

TỪ KHÓA LIÊN QUAN
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.