tailieunhanh - JavaScript Bible, Gold Edition part 183

JavaScript Bible, Gold Edition part 183. 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. | CD-312 Part VI Appendixes Listing 16-40 continued function checkEnter if 13 handleOK SCRIPT HEAD BODY BGCOLOR eeeeee onLoad init H2 Web Site Preferences H2 HR TABLE BORDER 0 CELLSPACING 2 FORM NAME prefs onSubmit return false TR TD Enter your first name INPUT NAME name TYPE text VALUE SIZE 20 onKeyDown checkEnter TR TR TD Select a background color SELECT NAME bgColor OPTION VALUE beige Beige OPTION VALUE antiquewhite Antique White OPTION VALUE goldenrod Goldenrod OPTION VALUE lime Lime OPTION VALUE powderblue Powder Blue OPTION VALUE slategray Slate Gray SELECT TR TR TD Select a text color SELECT NAME textColor OPTION VALUE black Black OPTION VALUE white White OPTION VALUE navy Navy Blue OPTION VALUE darkorange Dark Orange OPTION VALUE seagreen Sea Green OPTION VALUE teal Teal SELECT TR TR TD Select Welcome heading font point size SELECT NAME h1Size OPTION VALUE 12 12 OPTION VALUE 14 14 OPTION VALUE 18 18 w ndowOb Appendix F Examples from Parts III and IV CD-313 OPTION VALUE 24 24 OPTION VALUE 32 32 OPTION VALUE 48 48 SELECT TR TABLE FORM DIV STYLE position absolute left 200px top 220px BUTTON STYLE width 80px onClick handleOK OK BUTTON nbsp nbsp BUTTON STYLE width 80px onClick handleCancel Cancel BUTTON DIV BODY HTML One last convenience feature of the dialog box window is the onKeyPress event handler in the text box. The function it invokes looks for the Enter key. If that key is pressed while the box has focus the same handleOK function is invoked as if the user had clicked the OK button. This feature makes the dialog box behave as if the OK button is an automatic default just as real dialog boxes. You should observe several important structural changes that were made to turn the modal approach into a modeless one. Listing 16-41 shows the version of the main window modified for use with a modeless dialog box. Another global variable prefsDlog is initialized to eventually store the reference to the modeless window returned

TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
crossorigin="anonymous">
Đã 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.