Synopses & Reviews
JavaScript for the World Wide Web, 4th Edition: Visual QuickStart Guide is the perfect book for those who are familiar with HTML and are ready to move up to the next level to add some pizzazz and interactivity to their Web site. Using a task-based, visual step-by-step approach and loads of useful illustrations, readers learn the basics of JavaScript: creating rollovers and frames, validating forms, working with browser windows, adding dynamic elements to your site, and more.
This revised bestseller has been expanded with five new chapters and a new appendix. New material can be found in the following chapters:
- Forms and Regular Expressions
- Handling Events
- Introducing Cascading Style Sheets
- Applied JavaScript
- Bookmarklets
- and a new appendix: Cascading Style Sheets Reference
An exciting new feature of this book is the 16-page color appendix of the JavaScript Object Flowchart and the JavaScript Object Table, all in glorious four-color detail.
Don't want to wear out your fingers by typing in all that code? Check out the supplemental Web site, where you can find all the scripts ready for you to cut and paste into your own work, as well as additional notes, addenda, and updates.
Synopsis
This fully revised second edition is aimed at the large group of less technical Web authors who know HTML but know nothing about programming. As a simple programming language designed to be used with HTML, JavaScript is the next step in making Web pages more powerful. With JavaScript, even Web page creators without a programming bone in their body can call up pre-cooked Java animations, add clocks and other time-based features to their Web pages, enable their pages to ask questions and gather information from visitors, and provide other interactive features.
About the Author
Veteran journalist and Mac guru Tom Negrino is the author of Macromedia Contribute for Windows: Visual QuickStart Guide and numerous other Visual QuickStart guides, including (with Dori Smith) the last three editions of this volume. Dori Smith is a programmer and journalist who, like Tom, has several Visual QuickStart Guides under her belt, including Java 2 for the World Wide Web: Visual QuickStart Guide. Both authors are on the Steering Committee for the Web Standards Project.
Table of Contents
Introduction.
1. Getting Acquainted with JavaScript.
What JavaScript Is. What JavaScript Can Do. JavaScript Isn't Java. The Snap-together Language. Handling Events. Values and Variables. Assignments and Comparisons. What Tools to Use?
2. Start Me Up!
Where to Put Your Scripts. Hiding Scripts from Old Browsers. Putting Comments in Scripts. Alerting the User. Confirming a User's Choice. Prompting the User. Redirecting the User. Redirecting the User with a Link. Browser Detection. Plug-in Detection. Around and around with Loops. Checking if Java Is Enabled. Functions. Putting More Than One Script on a Page. Scrolling Status Bars. Status Bar Messages.
3. Fun with Images.
Creating Rollovers. Creating More Effective Rollovers. Putting Multiple Rollovers on a Page. Triggering Rollovers from a Link. Multiple Images Changing a Single Rollover. Working with Multiple Rollovers. Using a Function to Simplify Coding Multiple Images with a Single Rollover. Using a Function to Simplify Coding Multiple Rollovers. Creating Cycling Banners. Making the Banner Cycling Wait for the User. Adding Links to Cycling Banners. Building Slide Shows. Building Wraparound Slide Shows. Displaying a Random Image. Displaying Multiple Random Images. Combining a Rollover with an Image Map. Automatically Changing Background Colors.
4. Frames, Frames, and More Frames.
Keeping a Page out of a Frame. Forcing a Page into a Frame. Forcing a Site into a Frame. Loading a Frame. Creating and Loading a Dynamic Frame. Sharing Functions between Frames. Storing Information in Frames. Loading Multiple Frames at Once. Browser Detection with Frames.
5. Working with Browser Windows.
Opening a New Window. Loading Different Contents into a Window. Opening a New Window Using an Image Link. Scrolling a Window. Updating One Window from Another. Creating New Pages with JavaScript. Closing a Window. Creating a Control Panel. Positioning a Window on the Screen. Displaying an Alert when a Window Is Loaded.
6. Validating Forms.
Verifying Passwords. Select-and-Go Navigation. Selecting Menu Items. Working with Radio Buttons. Setting One Field with Another. Validating Zip Codes. Validating Email Addresses.
7. Forms and Regular Expressions.
Validating an Email Address with Regular Expressions. Validating a File Name. Extracting Strings. Formatting Strings. Formatting and Sorting Strings. Formatting and Validating Strings.
8. Making Your Pages Dynamic.
Putting the Current Date into a Web Page. Working with Days. Customizing A Message for the Time of Day. Displaying Dates by Time Zone. Converting Military Time to AM/PM. Creating a Countdown. Working with Referrer Pages. Writing Text into a Document on the Fly. Date Methods.
9. Handling Events.
Handling Windows Events. Mouse Event Handling. Form Event Handling. Key Event Handling.
10. JavaScript and Cookies.
Baking Your First Cookie. Reading a Cookie. Showing Your Cookies. Using Cookies as Counters. Deleting Cookies. Handling Multiple Cookies. Displaying “New to You” Messages.
11. Introducing CCS.
Saying It with Style. Styles with Class. Changing Fonts with CSS. Checking Your ID. Styles and Spans. Distinguished Links. Positioning Absolutely.
12. Working with DHTML.
DHTML Browsers & “Standards.” Moving an Object in Two Dimensions (Netscape 4.x only). Moving an Object in Two Dimensions (IE Mac and IE Windows). Moving an Object in Two Dimensions (Netscape 6 only). Moving an Object in Two Dimensions (Cross-browser). Moving an Object in Three Dimensions (Netscape 4.x only). Moving an Object in Three Dimensions (Netscape 6 only). Moving an Object in Three Dimensions (Cross-browsers). Moving DHTML Text. Modifying a DHTML Drop Shadow. Rotating a DHTML Shadow. Modifying a DHTML Glow.
13. Using Interface Design with JavaSript.
Pull-Down Menus. Sliding Menus. Tool Tips. Click-Anywhere Form Fields.
14. Applied JavaSript.
Using an External .js File. A Slideshow with Captions. A Silly Name Generator. Bar Graph Generator.
15. Bookmarklets.
Your First Bookmarklet. Changing a Page's Background Color. Web-safe Colors. Word Lookups. Viewing Images. Displaying ISO Latin Characters. Converting RGB Values to Hex. Converting Values. A Bookmarklet Calculator.
16. Working with Visual Tools.
The Pros and Cons of Visual Tools. Using Behaviors in Dreamweaver. Flying Objects in Adobe GoLive. Creating Pop-Up Menus in Fireworks. Customizing Dreamweaver.
17. Debugging Common Errors.
The Built-In Debugging Aids. JavaScript Debuggers. Common Errors. Following Variables while a Script is Running. Viewing Variables in Another Window. Writing Error Messages to Another Window.
Appendix A. JavaScript Genealogy and Reference.
JavaScript Versions. ECMAScript. Browsers and JavaScript. Object Flowchart. The Big Object Table.
Appendix B. JavaScript Reserved Words.
Appendix C. Cascading Style Sheets Reference.
Appendix D. Where to Learn More.
Finding Help on the Web. Books.
Index.