14
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 JavaScript and XHTML Documents Programming the World Wide Web Fourth edition By Robert W. Sebesta

Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 JavaScript and XHTML Documents Programming the World Wide Web Fourth

Embed Size (px)

Citation preview

Page 1: Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 JavaScript and XHTML Documents Programming the World Wide Web Fourth

Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

Chapter 5JavaScript and

XHTML Documents

Programming the World Wide Web Fourth edition

By Robert W. Sebesta

Page 2: Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 JavaScript and XHTML Documents Programming the World Wide Web Fourth

5-2Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

Figure 5.1 The DOM structure for a simple document

Page 3: Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 JavaScript and XHTML Documents Programming the World Wide Web Fourth

5-3Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

Table 5.1 Events and their tag attributes

Page 4: Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 JavaScript and XHTML Documents Programming the World Wide Web Fourth

5-4Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

Table 5.2 Event attributes and their tags

Page 5: Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 JavaScript and XHTML Documents Programming the World Wide Web Fourth

5-5Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

Table 5.2 Event attributes and their tags (cont)

Page 6: Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 JavaScript and XHTML Documents Programming the World Wide Web Fourth

5-6Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

Figure 5.2 Display of load.html

Page 7: Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 JavaScript and XHTML Documents Programming the World Wide Web Fourth

5-7Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

Figure 5.3 Display of radio_click.html

Page 8: Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 JavaScript and XHTML Documents Programming the World Wide Web Fourth

5-8Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

Figure 5.4 The result of pressing the Model 182 button in radio_click

Page 9: Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 JavaScript and XHTML Documents Programming the World Wide Web Fourth

5-9Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

Figure 5.5 Display of pswd_chk.html after it has been filled out

Page 10: Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 JavaScript and XHTML Documents Programming the World Wide Web Fourth

5-10Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

Figure 5.6 Display of pswd_chk.html after Submit Query has been clicked

Page 11: Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 JavaScript and XHTML Documents Programming the World Wide Web Fourth

5-11Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

Figure 5.7 Display of validator.html, with an invalid phone number, while the phone text field has focus

Page 12: Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 JavaScript and XHTML Documents Programming the World Wide Web Fourth

5-12Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

Figure 5.8 The message created by entering an invalid telephone number in validator.html

Page 13: Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 JavaScript and XHTML Documents Programming the World Wide Web Fourth

5-13Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

Figure 5.9 The navigator properties appName and appVersion for Firefox 2

Page 14: Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 JavaScript and XHTML Documents Programming the World Wide Web Fourth

5-14Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

Figure 5.10 The navigator properties appName and appVersion for Internet Explorer 7