The Book of JavaScript, 2nd Edition
Read it now on the O’Reilly learning platform with a 10-day free trial.
O’Reilly members get unlimited access to books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.
Book description
The Book of JavaScript teaches readers how to add interactivity, animation, and other tricks to their web sites with JavaScript. Rather than provide a series of cut-and-paste scripts, thau! takes the reader through a series of real world JavaScript code with an emphasis on understanding. Each chapter focuses on a few important JavaScript features, shows how professional web sites incorporate them, and takes readers through examples of how they might add those features to their own web sites. This thoroughly updated 2nd edition includes new chapters on Ajax, revised appendices, and new examples throughout. Summary sections and assignments close each chapter, making the book perfect for use in college courses or independent study. CD includes code and images for every example, answers to assignments, script libraries for hard-to-program applications, and many useful software programs.
Table of contents
-
The Book of JavaScript, 2nd Edition
- ADVANCE PRAISE FOR THE BOOK OF JAVASCRIPT, 2ND EDITION
- PRAISE FOR THE BOOK OF JAVASCRIPT, 1ST EDITION
- FOREWORD
- FOREWORD TO THE FIRST EDITION
- ACKNOWLEDGMENTS
- INTRODUCTION
- 1. WELCOME TO JAVASCRIPT!
- 2. USING VARIABLES AND BUILT-IN FUNCTIONS TO UPDATE YOUR WEB PAGES AUTOMATICALLY
- 3. GIVING THE BROWSERS WHAT THEY WANT
- 4. WORKING WITH ROLLOVERS
- 5. OPENING AND MANIPULATING WINDOWS
- 6. WRITING YOUR OWN JAVASCRIPT FUNCTIONS
-
7. PROVIDING AND RECEIVING INFORMATION WITH FORMS
- Real-World Examples of Forms
- Form Basics
- Forms and JavaScript
- Reading and Setting Form Elements
- Handling Events Using Form Elements
- Make this a Shortcut
- Using Pull-Down Menus as Navigational Tools
- One Last Forms Shortcut
- How the Doctors Without Borders Pull-Down Navigation Tool Works
- Summary
- Assignment
-
8. KEEPING TRACK OF INFORMATION WITH ARRAYS AND LOOPS
- Real-World Examples of Arrays
- JavaScript's Built-In Arrays
- Figuring Out How Many Items an Array Contains
- Going Through Arrays
- while Loops
- for Loops
- How AntWeb Checks Off All the Checkboxes
- Creating Your Own Arrays
- How the Book of JavaScript Tip Box Works
- Loops Can Nest
- Creating Arrays As You Go Along
- Associative Arrays
- Summary
- Assignment
-
9. TIMING EVENTS
- Real-World Examples of Timing Events
- Setting an Alarm with setTimeout()
- Canceling an Alarm with clearTimeout()
- Repeating Timed Actions
- Building a Clock with Timing Loops
- How the Book of JavaScript Website's Timer Works
- How Space.com's Countdown Script Works
- A Timed Slide Show
- A Safer Version of rotateImage()
- Summary
- Assignment
-
10. USING FRAMES AND IMAGE MAPS
- A Real-World Example of Frames and Image Maps
- Frames
- Image Maps
- How Salon's Bug-Eating Script Works
- Summary
- Assignment
- 11. VALIDATING FORMS, MASSAGING STRINGS, AND WORKING WITH SERVER-SIDE PROGRAMS
- 12. SAVING VISITOR INFORMATION WITH COOKIES
- 13. DYNAMIC HTML
- 14. AJAX BASICS
- 15. XML IN JAVASCRIPT AND AJAX
-
16. SERVER-SIDE AJAX
- Real-World Examples of Server-Side Ajax
- The Power of Webservers
- A Server-Side Programming Language
- PHP Basics
- Sending Simple Input to PHP with a GET Request
- Creating a Google Suggest Application with an Ajax GET Request
- Ajax and the POST Method
- HEAD Requests: Getting Information About a Server-Side File
- The Caching Problem
- File Handling in PHP
- When Communication Breaks Down
- Automatically Updating a Web Page When a Server-Side File Changes
- Summary
- Assignment
-
17. PUTTING IT ALL TOGETHER IN A SHARED TO DO LIST
- Features of the To Do List Application
- To Do List Data Files
- To Do List Server Side
- The To Do List Client Side, Part 1: The HTML
- The To Do List Client Side, Part 2: The JavaScript
- A Few Closing Notes
- Summary
- Assignment
- 18. DEBUGGING JAVASCRIPT AND AJAX
- A. ANSWERS TO ASSIGNMENTS
- B. RESOURCES
-
C. REFERENCE TO JAVASCRIPT OBJECTS AND FUNCTIONS
- alert() [FF, IE 3]
- Anchor
- Applet
- Area [FF, IE 3]
- Array [FF, IE 3]
- Button (Including Submit and Reset Buttons)
- Checkbox
- clearInterval() [FF, IE 4]
- clearTimeout() [FF, IE 3]
- confirm() [FF, IE 3]
- Date
- Document
- elements[] [FF, IE 3]
- escape() [FF, IE 3]
- eval() [FF, IE 3]
- Event
- FileUpload
- Form
- Hidden
- History
- HTMLElement [FF, IE 4]
- Image
- isNaN() [FF, IE 4]
- Link
- Location
- Math [FF, IE 3]
- Navigator
- Number
- Option
- parseInt() [FF, IE 3]
- parseFloat() [FF, IE 3]
- Password
- prompt()
- Radio
- Reset
- Screen
- Select
- setInterval() [FF, IE 4]
- setTimeout() [FF, IE 3]
- String
- Style [FF, IE 4]
- Submit
- Text
- Textarea
- this [FF, IE 3]
- unescape() [FF, IE 3]
- var [FF, IE 3]
- window
- XMLHttpRequest [FF] and ActiveXObject("Microsoft.XMLHTTP") [IE 5.5]
- D. CHAPTER 15'S ITALIAN TRANSLATOR AND CHAPTER 17'S TO DO LIST APPLICATION
- COLOPHON
Product information
- Title: The Book of JavaScript, 2nd Edition
- Author(s): thau!
- Release date: December 2006
- Publisher(s): No Starch Press
- ISBN: 9781593271060
You might also like
book
JavaScript & DHTML Cookbook, 2nd Edition
by Danny Goodman
In today's Web 2.0 world, JavaScript and Dynamic HTML are at the center of the hot …
book
The Principles of Object-Oriented JavaScript
by Nicholas C. Zakas
The Principles of Object-Oriented JavaScript helps experienced programmers understand JavaScript's unique approach to object-oriented programming so …
book
HTML5 Pocket Reference, 5th Edition
by Jennifer Robbins
Need help finding the right HTML5 element or attribute for your web page or application? HTML5 …
book
The JavaScript Workshop
by Joseph Labrecque, Jahred Love, Daniel Rosenbaum, Nick Turner, Gaurav Mehla, Alonzo L. Hosford, Florian Sloot, Philip Kirkbride
Get to grips with the fundamentals of JavaScript and learn to build the programming skills that …