Book description
The bestselling JavaScript reference, now updated to reflect changes in technology and best practices
As the most comprehensive book on the market, the JavaScript Bible is a classic bestseller that keeps you up to date on the latest changes in JavaScript, the leading technology for incorporating interactivity into Web pages. Part tutorial, part reference, this book serves as both a learning tool for building new JavaScript skills as well as a detailed reference for the more experienced JavaScript user.
You'll get up-to-date coverage on the latest JavaScript practices that have been implemented since the previous edition, as well as the most updated code listings that reflect new concepts. Plus, you'll learn how to apply the latest JavaScript exception handling and custom object techniques.
Follows in the tradition of previous edition bestsellers, providing a thorough reference on JavaScript, the leading technology for making Web pages interactive
Serves as a reference and tutorial and is packed with numerous working code examples
Includes new developments in the ECMAScript 5th Edition standard on which JavaScript is based.
Promotes state-of-the-art industry best practices including progressive enhancement, unobtrusive JavaScript, and separation of development layers
Shows how to write scripts for mouse rollover effects, drag-and-drop, and interaction with stylesheets
Reviews deployment strategies that best suit your content goals and target audience
Practical examples of working code round out this new edition and contribute to helping you learn JavaScript quickly yet thoroughly.
Table of contents
- Copyright
- About the Authors
- About the Technical Editor
- Credits
- Acknowledgments
-
Introduction
-
Organization and Features of This Edition
- Part I: Getting Started with JavaScript
- Part II: JavaScript Tutorial
- Part III: JavaScript Core Language Reference
- Part IV: Document Objects Reference
- Part V: Appendixes
- Part VI: Document Objects Reference (continued)
- Part VII: More JavaScript Programming
- Part VIII: Applications
- Part IX: Appendixes (continued)
- CD-ROM
- Prerequisites to Learning JavaScript
- Formatting and Naming Conventions
-
Organization and Features of This Edition
-
I. Getting Started with JavaScript
- 1. JavaScript's Role in the World Wide Web and Beyond
- 2. Developing a Scripting Strategy
- 3. Selecting and Using Your Tools
-
4. JavaScript Essentials
- 4.1. Combining JavaScript with HTML
- 4.2. Designing for Compatibility
- 4.3. Language Essentials for Experienced Programmers
-
II. JavaScript Tutorial
- 5. Your First JavaScript Script
- 6. Browser and Document Objects
- 7. Scripts and HTML Documents
- 8. Programming Fundamentals, Part I
- 9. Programming Fundamentals, Part II
- 10. Window and Document Objects
- 11. Forms and Form Elements
- 12. Strings, Math, and Dates
- 13. Scripting Frames and Multiple Windows
- 14. Images and Dynamic HTML
-
III. JavaScript Core Language Reference
- 15. The String Object
- 16. The Math, Number, and Boolean Objects
-
17. The Date Object
- 17.1. Time Zones and GMT
-
17.2. The Date Object
- 17.2.1. Creating a date object
- 17.2.2. Native object properties and methods
- 17.2.3. Date methods
- 17.2.4. Accommodating time zones
- 17.2.5. Dates as strings
- 17.2.6. Friendly date formats for older browsers
- 17.2.7. More conversions
- 17.2.8. Date and time arithmetic
- 17.2.9. Counting the days . . .
- 17.2.10. Early browser date bugs and gremlins
- 17.3. Validating Date Entries in Forms
-
18. The Array Object
- 18.1. Structured Data
- 18.2. Creating an Empty Array
- 18.3. Populating an Array
- 18.4. JavaScript Array Creation Enhancements
- 18.5. Deleting Array Entries
- 18.6. Parallel Arrays
- 18.7. Multidimensional Arrays
- 18.8. Simulating a Hash Table
- 18.9. Array Object
- 18.10. Array Comprehensions
- 18.11. Destructuring Assignment
- 18.12. Compatibility with Older Browsers
- 19. JSON—Native JavaScript Object Notation
- 20. E4X—Native XML Processing
-
21. Control Structures and Exception Handling
- 21.1. If and If. . .Else Decisions
- 21.2. Conditional Expressions
- 21.3. The switch Statement
- 21.4. Repeat (for) Loops
- 21.5. The while Loop
- 21.6. The do-while Loop
- 21.7. Looping through Properties (for-in)
- 21.8. The with Statement
- 21.9. Labeled Statements
- 21.10. Exception Handling
- 21.11. Using try-catch-finally Constructions
- 21.12. Throwing Exceptions
- 21.13. Error Object
- 22. JavaScript Operators
-
23. Function Objects and Custom Objects
- 23.1. Function Object
- 23.2. Function Application Notes
- 23.3. Creating Your Own Objects with Object-Oriented JavaScript
- 23.4. Object-Oriented Concepts
- 23.5. Object Object
- 24. Global Functions and Statements
-
IV. Document Objects Reference
-
25. Document Object Model Essentials
- 25.1. The Object Model Hierarchy
- 25.2. How Document Objects Are Born
- 25.3. Object Properties
- 25.4. Object Methods
- 25.5. Object Event Handlers
- 25.6. Object Model Smorgasbord
- 25.7. Basic Object Model
- 25.8. Basic Object Model Plus Images
- 25.9. Navigator 4–Only Extensions
- 25.10. Internet Explorer 4+ Extensions
- 25.11. Internet Explorer 5+ Extensions
- 25.12. The W3C DOM
- 25.13. Scripting Trends
- 25.14. Standards Compatibility Modes (DOCTYPE Switching)
- 25.15. Where to Go from Here
-
26. Generic HTML Element Objects
-
26.1. Generic Objects
- 26.1.1. Syntax
- 26.1.2. About these objects
-
26.1.3. Properties
- 26.1.3.1. Example
- 26.1.3.2. Example
- 26.1.3.3. Example
- 26.1.3.4. Example
- 26.1.3.5. Example
- 26.1.3.6. Example
- 26.1.3.7. Example
- 26.1.3.8. Example
- 26.1.3.9. Example
- 26.1.3.10. Example
- 26.1.3.11. Example
- 26.1.3.12. Example
- 26.1.3.13. Example
- 26.1.3.14. Example
- 26.1.3.15. Example
- 26.1.3.16. Example
- 26.1.3.17. Example
- 26.1.3.18. Example
- 26.1.3.19. Example
- 26.1.3.20. Example
- 26.1.3.21. Example
- 26.1.3.22. Example
- 26.1.3.23. Example
- 26.1.3.24. Example
- 26.1.3.25. Example
- 26.1.3.26. Example
- 26.1.3.27. Example
- 26.1.3.28. Example
- 26.1.3.29. Example
- 26.1.3.30. Example
- 26.1.3.31. Example
- 26.1.3.32. Example
- 26.1.3.33. Example
- 26.1.3.34. Example
- 26.1.3.35. Example
- 26.1.3.36. Example
- 26.1.3.37. Example
- 26.1.3.38. Example
- 26.1.3.39. Example
- 26.1.3.40. Example
- 26.1.3.41. Example
- 26.1.3.42. Example
- 26.1.3.43. Example
- 26.1.3.44. Example
- 26.1.3.45. Example
- 26.1.3.46. Example
- 26.1.3.47. Example
- 26.1.3.48. Example
- 26.1.3.49. Example
- 26.1.3.50. Example
-
26.1.4. Methods
- 26.1.4.1. Example
- 26.1.4.2. Example
- 26.1.4.3. Example
- 26.1.4.4. Example
- 26.1.4.5. Example
- 26.1.4.6. Windows
- 26.1.4.7. Form control elements
- 26.1.4.8. Other elements
- 26.1.4.9. Example
- 26.1.4.10. Example
- 26.1.4.11. Example
- 26.1.4.12. Example
- 26.1.4.13. Example
- 26.1.4.14. Example
- 26.1.4.15. Example
- 26.1.4.16. Example
- 26.1.4.17. Example
- 26.1.4.18. Example
- 26.1.4.19. Example
- 26.1.4.20. Example
- 26.1.4.21. Example
- 26.1.4.22. Example
- 26.1.4.23. Example
- 26.1.4.24. Example
- 26.1.4.25. Example
- 26.1.4.26. Example
- 26.1.4.27. Example
- 26.1.4.28. Example
- 26.1.4.29. Example
- 26.1.4.30. Example
- 26.1.4.31. Example
- 26.1.4.32. Example
- 26.1.4.33. Example
- 26.1.4.34. Example
- 26.1.4.35. Example
- 26.1.4.36. Example
- 26.1.4.37. Example
- 26.1.4.38. Example
- 26.1.4.39. Example
- 26.1.4.40. Example
- 26.1.4.41. Example
- 26.1.4.42. Example
- 26.1.4.43. Example
- 26.1.4.44. Example
- 26.1.4.45. Example
- 26.1.4.46. Example
- 26.1.4.47. Example
- 26.1.5. Event handlers
- 26.1.6. Common keyboard event tasks
-
26.1. Generic Objects
-
27. Window and Frame Objects
- 27.1. Window Terminology
-
27.2. Frames
- 27.2.1. Creating frames
- 27.2.2. The frame object model
- 27.2.3. Referencing frames
- 27.2.4. Top versus parent
- 27.2.5. Preventing framing
- 27.2.6. Ensuring framing
- 27.2.7. Switching from frames to frameless
- 27.2.8. Inheritance versus containment
- 27.2.9. Frame synchronization
- 27.2.10. Blank frames
- 27.2.11. Viewing frame source code
- 27.2.12. Frames versus frame element objects
-
27.3. window Object
- 27.3.1. Syntax
- 27.3.2. About this object
-
27.3.3. Properties
- 27.3.3.1. Example
- 27.3.3.2. Example
- 27.3.3.3. Example
- 27.3.3.4. Example
- 27.3.3.5. Example
- 27.3.3.6. Example
- 27.3.3.7. Example
- 27.3.3.8. Example
- 27.3.3.9. Example
- 27.3.3.10. Example
- 27.3.3.11. Example
- 27.3.3.12. Example
- 27.3.3.13. Example
- 27.3.3.14. Example
- 27.3.3.15. Example
- 27.3.3.16. Example
- 27.3.3.17. Example
- 27.3.3.18. Example
- 27.3.3.19. Example
- 27.3.3.20. Example
- 27.3.3.21. Example
- 27.3.3.22. Example
- 27.3.3.23. Example
-
27.3.4. Methods
- 27.3.4.1. Example
- 27.3.4.2. Example
- 27.3.4.3. Example
- 27.3.4.4. Example
- 27.3.4.5. Example
- 27.3.4.6. Example
- 27.3.4.7. Example
- 27.3.4.8. Example
- 27.3.4.9. Example
- 27.3.4.10. Example
- 27.3.4.11. Setting new window features
- 27.3.4.12. Netscape/Mozilla-only signed scripts
- 27.3.4.13. Specifying a window name
- 27.3.4.14. Loading content into a new window
- 27.3.4.15. Internet Explorer idiosyncrasies
- 27.3.4.16. Example
- 27.3.4.17. Example
- 27.3.4.18. Example
- 27.3.4.19. Example
- 27.3.4.20. Example
- 27.3.4.21. Passing function parameters
- 27.3.4.22. Example
- 27.3.4.23. Example
- 27.3.4.24. Retrieving dialog-box data
- 27.3.4.25. Dialog-box window features
- 27.3.4.26. Dialog-box cautions
- 27.3.4.27. Example
- 27.3.4.28. Example
- 27.3.5. Event handlers
- 27.4. frame Element Object
- 27.5. frameset Element Object
- 27.6. iframe Element Object
- 27.7. popup Object
- 28. Location and History Objects
-
29. Document and Body Objects
-
29.1. document Object
- 29.1.1. Syntax
- 29.1.2. About this object
-
29.1.3. Properties
- 29.1.3.1. Example
- 29.1.3.2. Example
- 29.1.3.3. Example
- 29.1.3.4. Example
- 29.1.3.5. Example
- 29.1.3.6. Example
- 29.1.3.7. Example
- 29.1.3.8. Example
- 29.1.3.9. The cookie file
- 29.1.3.10. A cookie record
- 29.1.3.11. JavaScript access
- 29.1.3.12. Saving cookies
- 29.1.3.13. Name/Data
- 29.1.3.14. Expires
- 29.1.3.15. Path
- 29.1.3.16. Domain
- 29.1.3.17. SECURE
- 29.1.3.18. Retrieving cookie data
- 29.1.3.19. Extra batches
- 29.1.3.20. Example
- 29.1.3.21. Example
- 29.1.3.22. Example
- 29.1.3.23. Example
- 29.1.3.24. Example
- 29.1.3.25. Example
- 29.1.3.26. Example
- 29.1.3.27. Example
- 29.1.3.28. Example
- 29.1.3.29. Example
- 29.1.3.30. Example
- 29.1.3.31. Example
- 29.1.3.32. Example
- 29.1.3.33. Example
- 29.1.3.34. Example
- 29.1.3.35. Example
- 29.1.3.36. Example
- 29.1.3.37. Example
- 29.1.3.38. Example
- 29.1.4. Methods
- 29.1.5. Event handlers
- 29.2. body Element Object
- 29.3. TreeWalker Object
-
29.1. document Object
- 30. Link and Anchor Objects
- 31. Image, Area, Map, and Canvas Objects
-
32. Event Objects
- 32.1. Why "Events"?
- 32.2. Event Propagation
- 32.3. Referencing the event Object
- 32.4. Binding Events
- 32.5. event Object Compatibility
- 32.6. Dueling Event Models
- 32.7. Event Types
- 32.8. NN6+/Moz event Object
-
25. Document Object Model Essentials
- V. Appendixes
-
VI. Document Objects Reference (continued)
-
33. Body Text Objects
- 33.1. blockquote and q Element Objects
- 33.2. br Element Object
- 33.3. font Element Object
- 33.4. h1...h6 Element Objects
- 33.5. hr Element Object
- 33.6. label Element Object
- 33.7. marquee Element Object
- 33.8. Range Object
- 33.9. selection Object
- 33.10. Text and TextNode Objects
-
33.11. TextRange Object
- 33.11.1. Syntax
- 33.11.2. About this object
- 33.11.3. Working with text ranges
- 33.11.4. About browser compatibility
- 33.11.5. Properties
-
33.11.6. Methods
- 33.11.6.1. Example
- 33.11.6.2. Example
- 33.11.6.3. Example
- 33.11.6.4. Example
- 33.11.6.5. Example
- 33.11.6.6. Example
- 33.11.6.7. Example
- 33.11.6.8. Example
- 33.11.6.9. Example
- 33.11.6.10. Example
- 33.11.6.11. Example
- 33.11.6.12. Example
- 33.11.6.13. Example
- 33.11.6.14. Example
- 33.11.6.15. Example
- 33.11.6.16. Example
- 33.11.6.17. Example
- 33.11.6.18. Example
- 33.12. TextRectangle Object
-
34. The Form and Related Objects
- 34.1. The Form in the Object Hierarchy
-
34.2. form Object
- 34.2.1. Syntax
- 34.2.2. About this object
- 34.2.3. References to form control elements
- 34.2.4. Passing forms and elements to functions
- 34.2.5. Emailing forms
- 34.2.6. Changing form attributes
- 34.2.7. Buttons in forms
- 34.2.8. Redirection after submission
- 34.2.9. Form element arrays
- 34.2.10. About <input> element objects
- 34.2.11. Properties
- 34.2.12. Methods
- 34.2.13. Event handlers
- 34.3. fieldset and legend Element Objects
- 34.4. label Element Object
- 34.5. Scripting and Web Forms 2.0
- 35. Button Objects
- 36. Text-Related Form Objects
- 37. Select, Option, and FileUpload Objects
-
38. Style Sheet and Style Objects
- 38.1. Making Sense of the Object Names
- 38.2. Imported Style Sheets
- 38.3. Reading Style Properties
- 38.4. style Element Object
- 38.5. styleSheet Object
- 38.6. cssRule and rule Objects
-
38.7. currentStyle, runtimeStyle, and style Objects
- 38.7.1. Syntax
- 38.7.2. About these objects
- 38.7.3. Style properties
- 38.7.4. Property values
- 38.7.5. Text and font properties
- 38.7.6. Inline display and layout properties
- 38.7.7. Positioning properties
- 38.7.8. Background properties
- 38.7.9. Border and edge properties
- 38.7.10. List properties
- 38.7.11. Scroll bar properties
- 38.7.12. Table properties
- 38.7.13. Page and printing properties
- 38.7.14. Miscellaneous properties
- 38.7.15. Aural properties
- 38.8. filter Object
- 39. Ajax, E4X, and XML
- 40. HTML Directive Objects
-
41. Table and List Objects
- 41.1. The Table Object Family Hierarchy
- 41.2. table Element Object
- 41.3. tbody, tfoot, and thead Element Objects
- 41.4. caption Element Object
- 41.5. col and colgroup Element Objects
- 41.6. tr Element Object
- 41.7. td and th Element Objects
- 41.8. ol Element Object
- 41.9. ul Element Object
- 41.10. li Element Object
- 41.11. dl, dt, and dd Element Objects
- 41.12. dir and menu Element Objects
-
42. The Navigator and Other Environment Objects
- 42.1. clientInformation Object (IE4+) and navigator Object (All)
- 42.2. mimeType Object
- 42.3. plugin Object
- 42.4. Looking for mime Types and Plug-Ins
- 42.5. screen Object
- 42.6. userProfile Object
- 43. Positioned Objects
- 44. Embedded Objects
- 45. The Regular Expression and RegExp Objects
-
33. Body Text Objects
-
VII. More JavaScript Programming
- 46. Data-Entry Validation
- 47. Scripting Java Applets and Plug-Ins
-
48. Debugging Scripts
- 48.1. Syntax versus Runtime Errors
- 48.2. Error Message Notification
-
48.3. Error Message Details
- 48.3.1. Error filename
- 48.3.2. Error location
-
48.3.3. Error message text
- 48.3.3.1. "Object expected"
- 48.3.3.2. "Expected <something>"
- 48.3.3.3. "<Something> is undefined"
- 48.3.3.4. "<Something> is not a function"
- 48.3.3.5. "Object doesn't support this property or method"
- 48.3.3.6. "Unterminated string literal"
- 48.3.3.7. "Unterminated string constant"
- 48.3.3.8. "Missing after function body"
- 48.3.3.9. "Expected"
- 48.3.3.10. "<Something> is not a number"
- 48.3.3.11. "<Something> has no property named . . ."
- 48.3.3.12. "<Something> has no properties"
- 48.3.3.13. "<Something> is null or not an object"
- 48.3.3.14. "<Something> has no property indexed by [i]"
- 48.3.3.15. "<Something> can't be set by assignment"
- 48.3.3.16. "Test for equality () mistyped as assignment ()? Assuming equality test"
- 48.3.3.17. "Function does not always return a value"
- 48.3.3.18. "Access disallowed from scripts at <URL> to documents at <URL<" "Access is denied"
- 48.3.3.19. "Unspecified error"
- 48.3.3.20. "Uncaught exception"
- 48.3.3.21. "Too many JavaScript errors"
- 48.4. Warnings in Mozilla's Console
- 48.5. Sniffing Out Problems
- 48.6. Debugging Tools
- 48.7. A Simple Trace Utility
- 48.8. Browser Crashes
- 48.9. Preventing Problems
- 48.10. Testing Your Masterpiece
-
49. Security and Netscape Signed Scripts
- 49.1. Battening Down the Hatches
- 49.2. When Worlds Collide
- 49.3. The Java Sandbox
- 49.4. Security Policies
- 49.5. The Same Origin Policy
- 49.6. The Netscape Signed Script Policy
- 49.7. The Digital Certificate
- 49.8. Signing Scripts
- 49.9. Accessing Protected Properties and Methods
- 49.10. Adding Privileges to Scripts
- 49.11. Examples
- 49.12. Handling Privilege Manager Errors
- 49.13. Signed Script Miscellany
- 50. Cross-Browser Dynamic HTML Issues
- 51. Internet Explorer Behaviors
-
VIII. Applications
- 52. Application: Tables and Calendars
- 53. Application: A Lookup Table
- 54. Application: A Poor Man's Order Form
- 55. Application: Outline-Style Table of Contents
- 56. Application: Calculations and Graphics
- 57. Application: Intelligent "Updated" Flags
- 58. Application: Decision Helper
- 59. Application: Cross-Browser DHTML Map Puzzle
- 60. Application: Transforming XML Data
- 61. Application: Creating Custom Google Maps
- IX. Appendixes (continued)
Product information
- Title: JavaScript® Bible, Seventh Edition
- Author(s):
- Release date: October 2010
- Publisher(s): Wiley
- ISBN: 9780470526910
You might also like
book
HTML5: The Missing Manual, 2nd Edition
HTML5 is more than a markup language—it’s a collection of several independent web standards. Fortunately, this …
audiobook
Transformed
Help transform your business and innovate like the world's top tech companies! Transformed: Moving to the …
book
Beyond jQuery
Learn about the most important concepts surrounding web development and demystify jQuery. This book gives you …
book
Innovation Leaders: How Senior Executives Stimulate, Steer and Sustain Innovation
Innovation leaders promote and address the innovation agenda in their company. Through personal conviction or competitive …