Beginning JavaScript®, Fourth Edition

Book description

The perennial bestseller returns with new details for using the latest tools and techniques available with JavaScript

JavaScript is the definitive language for making the Web a dynamic, rich, interactive medium. This guide to JavaScript builds on the success of previous editions and introduces you to many new advances in JavaScript development. The reorganization of the chapters helps streamline your learning process while new examples provide you with updated JavaScript programming techniques.

You'll get all-new coverage of Ajax for remote scripting, JavaScript frameworks, JavaScript and XML, and the latest features in modern Web browsers. Plus, all the featured code has been updated to ensure compliance with the most recent popular Web browsers.

  • Introduces you to the latest capabilities of JavaScript, the definitive language for developing dynamic, rich, interactive Web sites

  • Features new coverage of data types and variables, JavaScript and XML, Ajax for remote scripting, and popular JavaScript frameworks

  • Offers updated code that ensures compliance with the most popular Web browsers

  • Includes improved examples on the most up-to-date JavaScript programming techniques

Continuing in the superlative tradition of the first three editions, Beginning JavaScript, Fourth Edition, gets you up to speed on all the new advances in JavaScript development.

Note: CD-ROM/DVD and other supplementary materials are not included as part of eBook file.

Table of contents

  1. Copyright
  2. About the Authors
  3. Credits
  4. Acknowledgments
  5. Introduction
    1. Whom This Book Is For
    2. What This Book Covers
    3. What You Need to Use This Book
    4. Conventions
    5. Source Code
    6. Errata
    7. p2p.wrox.com
  6. 1. Introduction to JavaScript and the Web
    1. 1.1. Introduction to JavaScript
      1. 1.1.1. What Is JavaScript?
      2. 1.1.2. JavaScript and the Web
      3. 1.1.3. Why Choose JavaScript?
      4. 1.1.4. What Can JavaScript Do for Me?
      5. 1.1.5. Tools Needed to Create JavaScript Web Applications
        1. 1.1.5.1. Development Tools
        2. 1.1.5.2. Web Browsers
    2. 1.2. Where Do My Scripts Go?
      1. 1.2.1. Linking to an External JavaScript File
      2. 1.2.2. Advantages of Using an External File
    3. 1.3. Your First Simple JavaScript Programs
    4. 1.4. A Brief Look at Browsers and Compatibility Problems
    5. 1.5. Summary
  7. 2. Data Types and Variables
    1. 2.1. Types of Data in JavaScript
      1. 2.1.1. Numerical Data
      2. 2.1.2. Text Data
      3. 2.1.3. Boolean Data
    2. 2.2. Variables — Storing Data in Memory
      1. 2.2.1. Creating Variables and Giving Them Values
      2. 2.2.2. Assigning Variables with the Value of Other Variables
    3. 2.3. Using Data — Calculations and Basic String Manipulation
      1. 2.3.1. Numerical Calculations
        1. 2.3.1.1. Increment and Decrement Operators
      2. 2.3.2. Operator Precedence
      3. 2.3.3. Basic String Operations
      4. 2.3.4. Mixing Numbers and Strings
    4. 2.4. Data Type Conversion
      1. 2.4.1. Dealing with Strings That Won't Convert
    5. 2.5. Arrays
      1. 2.5.1. A Multi-Dimensional Array
    6. 2.6. Summary
    7. 2.7. Exercise Questions
  8. 3. Decisions, Loops, and Functions
    1. 3.1. Decision Making — The if and switch Statements
      1. 3.1.1. Comparison Operators
        1. 3.1.1.1. Precedence
        2. 3.1.1.2. Assignment versus Comparison
        3. 3.1.1.3. Assigning the Results of Comparisons
      2. 3.1.2. The if Statement
      3. 3.1.3. Logical Operators
        1. 3.1.3.1. AND
        2. 3.1.3.2. OR
        3. 3.1.3.3. NOT
      4. 3.1.4. Multiple Conditions Inside an if Statement
      5. 3.1.5. else and else if
      6. 3.1.6. Comparing Strings
      7. 3.1.7. The switch Statement
        1. 3.1.7.1. Executing the Same Code for Different Cases
    2. 3.2. Looping — The for and while Statements
      1. 3.2.1. The for Loop
      2. 3.2.2. The for. . .in Loop
      3. 3.2.3. The while Loop
      4. 3.2.4. The do. . .while loop
      5. 3.2.5. The break and continue Statements
    3. 3.3. Functions
      1. 3.3.1. Creating Your Own Functions
      2. 3.3.2. Variable Scope and Lifetime
    4. 3.4. Summary
    5. 3.5. Exercise Questions
  9. 4. Common Mistakes, Debugging, and Error Handling
    1. 4.1. D'oh! I Can't Believe I Just Did That: Some Common Mistakes
      1. 4.1.1. Undefined Variables
      2. 4.1.2. Case Sensitivity
      3. 4.1.3. Incorrect Number of Closing Braces
      4. 4.1.4. Incorrect Number of Closing Parentheses
      5. 4.1.5. Using Equals (=) Rather than Is Equal To (==)
      6. 4.1.6. Using a Method as a Property and Vice Versa
      7. 4.1.7. Missing Plus Signs During Concatenation
    2. 4.2. Error Handling
      1. 4.2.1. Preventing Errors
      2. 4.2.2. The try . . . catch Statements
        1. 4.2.2.1. Throwing Errors
        2. 4.2.2.2. Nested try. . .catch Statements
        3. 4.2.2.3. finally Clauses
    3. 4.3. Debugging
      1. 4.3.1. Debugging in Firefox with Firebug
        1. 4.3.1.1. Setting Breakpoints
        2. 4.3.1.2. Watches
        3. 4.3.1.3. Stepping Through Code
        4. 4.3.1.4. The Console
        5. 4.3.1.5. Call Stack Window
      2. 4.3.2. Debugging in Internet Explorer
        1. 4.3.2.1. Setting Breakpoints
        2. 4.3.2.2. Adding Watches
        3. 4.3.2.3. Stepping Through Code
        4. 4.3.2.4. The Console
      3. 4.3.3. Debugging in Safari
        1. 4.3.3.1. Setting Breakpoints
        2. 4.3.3.2. No Watches for You!
        3. 4.3.3.3. Stepping Through Code
        4. 4.3.3.4. The Console
      4. 4.3.4. Using Dragonfly: Opera's Development Tools
        1. 4.3.4.1. Setting Breakpoints
        2. 4.3.4.2. Stepping Through Code
    4. 4.4. Summary
    5. 4.5. Exercise Questions
  10. 5. JavaScript — An Object-Based Language
    1. 5.1. Object-Based Programming
      1. 5.1.1. What Are Objects?
      2. 5.1.2. Objects in JavaScript
      3. 5.1.3. Using JavaScript Objects
        1. 5.1.3.1. Creating an Object
        2. 5.1.3.2. Using an Object's Properties
        3. 5.1.3.3. Calling an Object's Methods
      4. 5.1.4. Primitives and Objects
    2. 5.2. JavaScript's Native Object Types
      1. 5.2.1. String Objects
        1. 5.2.1.1. The length Property
        2. 5.2.1.2. Finding a String Inside Another String — The indexOf() and lastIndexOf() Methods
        3. 5.2.1.3. Copying Part of a String — The substr() and substring() Methods
        4. 5.2.1.4. Converting Case — The toLowerCase() and toUpperCase() Methods
        5. 5.2.1.5. Selecting a Single Character from a String — The charAt() and charCodeAt() Methods
        6. 5.2.1.6. Converting Character Codes to a String — The fromCharCode() Method
      2. 5.2.2. Array Objects
        1. 5.2.2.1. Finding Out How Many Elements Are in an Array — The length Property
        2. 5.2.2.2. Joining Arrays — The concat() Method
        3. 5.2.2.3. Copying Part of an Array — The slice() Method
        4. 5.2.2.4. Converting an Array into a Single String — The join() Method
        5. 5.2.2.5. Putting Your Array in Order — The sort() Method
        6. 5.2.2.6. Putting Your Array into Reverse Order — The reverse() Method
      3. 5.2.3. New Array Methods
        1. 5.2.3.1. Finding Array Elements — The indexOf() and lastIndexOf() Methods
        2. 5.2.3.2. Iterating Through an Array Without Loops
          1. 5.2.3.2.1. Testing Each Element — The every(), some(), and filter() Methods
          2. 5.2.3.2.2. Operating on Elements — The forEach() and map() Methods
      4. 5.2.4. The Math Object
        1. 5.2.4.1. The abs() Method
        2. 5.2.4.2. Finding the Largest and Smallest Numbers: the min() and max() Methods
        3. 5.2.4.3. Rounding Numbers
          1. 5.2.4.3.1. The ceil() Method
          2. 5.2.4.3.2. The floor() Method
          3. 5.2.4.3.3. The round() Method
          4. 5.2.4.3.4. Summary of Rounding Methods
        4. 5.2.4.4. The random() Method
        5. 5.2.4.5. The pow() Method
      5. 5.2.5. Number Object
      6. 5.2.6. The toFixed() Method
      7. 5.2.7. Date Objects
        1. 5.2.7.1. Creating a Date Object
        2. 5.2.7.2. Getting Date Values
        3. 5.2.7.3. Setting Date Values
        4. 5.2.7.4. Calculations and Dates
        5. 5.2.7.5. Getting Time Values
        6. 5.2.7.6. Setting Time Values
    3. 5.3. Creating New Types of Objects (Reference Types)
      1. 5.3.1. Defining a Reference Type
      2. 5.3.2. Creating and Using Reference Type Instances
      3. 5.3.3. An Array of Items
    4. 5.4. Summary
    5. 5.5. Exercise Questions
  11. 6. Programming the Browser
    1. 6.1. Introduction to the Browser's Objects
      1. 6.1.1. The window Object
      2. 6.1.2. The history Object
      3. 6.1.3. The location Object
      4. 6.1.4. The navigator Object
      5. 6.1.5. The screen Object
      6. 6.1.6. The document Object
      7. 6.1.7. Using the document Object
      8. 6.1.8. The images Collection
      9. 6.1.9. The links Collection
    2. 6.2. Responding to the User's Actions with Events
      1. 6.2.1. What Are Events?
      2. 6.2.2. Connecting Code to Events
        1. 6.2.2.1. Handling Events via HTML Attributes
        2. 6.2.2.2. Handling Events via Object Properties
      3. 6.2.3. Determining the User's Browser
        1. 6.2.3.1. No Script at All
        2. 6.2.3.2. Browser Checking Using the Navigator Object
    3. 6.3. Summary
    4. 6.4. Exercise Questions
  12. 7. HTML Forms: Interacting with the User
    1. 7.1. HTML Forms
    2. 7.2. Other Form Object Properties and Methods
    3. 7.3. HTML Elements in Forms
      1. 7.3.1. Common Properties and Methods
        1. 7.3.1.1. The name Property
        2. 7.3.1.2. The value Property
        3. 7.3.1.3. The form Property
        4. 7.3.1.4. The type Property
        5. 7.3.1.5. The focus() and blur() Methods
      2. 7.3.2. Button Elements
      3. 7.3.3. Text Elements
        1. 7.3.3.1. The Text Box
        2. 7.3.3.2. Problems with Firefox and the blur Event
        3. 7.3.3.3. The Password Text Box
        4. 7.3.3.4. The Hidden Text Box
      4. 7.3.4. The textarea Element
      5. 7.3.5. Check Boxes and Radio Buttons
      6. 7.3.6. Selection Boxes
        1. 7.3.6.1. Adding and Removing Options
        2. 7.3.6.2. Adding New Options with Standard Methods
        3. 7.3.6.3. Select Element Events
    4. 7.4. Summary
    5. 7.5. Exercise Questions
  13. 8. Windows and Frames
    1. 8.1. Frames and the window Object
      1. 8.1.1. Coding Between Frames
      2. 8.1.2. Code Access Between Frames
        1. 8.1.2.1. The top Property
        2. 8.1.2.2. Scripting IFrames
    2. 8.2. Opening New Windows
      1. 8.2.1. Opening a New Browser Window
        1. 8.2.1.1. Adding HTML to a New Window
        2. 8.2.1.2. Adding Features to Your Windows
      2. 8.2.2. Scripting Between Windows
      3. 8.2.3. Moving and Resizing Windows
    3. 8.3. Security
    4. 8.4. Summary
    5. 8.5. Exercise Questions
  14. 9. String Manipulation
    1. 9.1. Additional String Methods
      1. 9.1.1. The split() Method
      2. 9.1.2. The replace() Method
      3. 9.1.3. The search() Method
      4. 9.1.4. The match() Method
    2. 9.2. Regular Expressions
      1. 9.2.1. Simple Regular Expressions
      2. 9.2.2. Regular Expressions: Special Characters
        1. 9.2.2.1. Text, Numbers, and Punctuation
        2. 9.2.2.2. Repetition Characters
        3. 9.2.2.3. Position Characters
      3. 9.2.3. Covering All Eventualities
      4. 9.2.4. Grouping Regular Expressions
      5. 9.2.5. Reusing Groups of Characters
    3. 9.3. The String Object — split(), replace(), search(), and match() Methods
      1. 9.3.1. The split() Method
      2. 9.3.2. The replace() Method
      3. 9.3.3. The search() Method
      4. 9.3.4. The match() Method
    4. 9.4. Using the RegExp Object's Constructor
      1. 9.4.1. Telephone Number Validation
      2. 9.4.2. Validating a Postal Code
      3. 9.4.3. Validating an E-mail Address
      4. 9.4.4. Validating a Domain Name
        1. 9.4.4.1. Validating a Person's Address
        2. 9.4.4.2. Validating the Complete Address
    5. 9.5. Summary
    6. 9.6. Exercise Questions
  15. 10. Date, Time, and Timers
    1. 10.1. World Time
      1. 10.1.1. Setting and Getting a Date Object's UTC Date and Time
    2. 10.2. Timers in a Web Page
      1. 10.2.1. One-Shot Timer
      2. 10.2.2. Setting a Timer that Fires at Regular Intervals
    3. 10.3. Summary
    4. 10.4. Exercise Questions
  16. 11. Storing Information: Cookies
    1. 11.1. Baking Your First Cookie
      1. 11.1.1. A Fresh-Baked Cookie
        1. 11.1.1.1. Viewing Cookies in IE
        2. 11.1.1.2. Viewing Cookies in Firefox
      2. 11.1.2. The Cookie String
        1. 11.1.2.1. name and value
        2. 11.1.2.2. expires
        3. 11.1.2.3. path
        4. 11.1.2.4. domain
        5. 11.1.2.5. secure
    2. 11.2. Creating a Cookie
    3. 11.3. Getting a Cookie's Value
    4. 11.4. Cookie Limitations
      1. 11.4.1. A User May Disable Cookies
      2. 11.4.2. Number and Information Limitation
    5. 11.5. Cookie Security and IE6+
    6. 11.6. Summary
    7. 11.7. Exercise Questions
  17. 12. Dynamic HTML and the W3C Document Object Model
    1. 12.1. The Web Standards
      1. 12.1.1. HTML
      2. 12.1.2. XML
      3. 12.1.3. XHTML
      4. 12.1.4. ECMAScript
    2. 12.2. The Document Object Model
      1. 12.2.1. The DOM Standard
        1. 12.2.1.1. Level 0
        2. 12.2.1.2. Level 1
        3. 12.2.1.3. Level 2
        4. 12.2.1.4. Level 3
        5. 12.2.1.5. Browser Compliance with the Standards
      2. 12.2.2. Differences Between the DOM and the BOM
      3. 12.2.3. Representing the HTML Document as a Tree Structure
        1. 12.2.3.1. What Is a Tree Structure?
        2. 12.2.3.2. An Example HTML Page
      4. 12.2.4. The Core DOM Objects
        1. 12.2.4.1. Base DOM Objects
        2. 12.2.4.2. High-Level DOM Objects
      5. 12.2.5. DOM Objects and Their Properties and Methods
        1. 12.2.5.1. The Document Object and its Methods
          1. 12.2.5.1.1. Finding Elements or an Element
          2. 12.2.5.1.2. Creating Elements and Text
          3. 12.2.5.1.3. Property of the Document Object: Getting the Document's Root Element
        2. 12.2.5.2. The Element Object
          1. 12.2.5.2.1. Getting the Element's Tag Name: The tagName Property
          2. 12.2.5.2.2. Methods of the Element Object: Getting and Setting Attributes
        3. 12.2.5.3. The Node Object
          1. 12.2.5.3.1. The Node Object: Navigating the DOM
          2. 12.2.5.3.2. Methods of the Node Object
    3. 12.3. Manipulating the DOM
      1. 12.3.1. Accessing Elements
      2. 12.3.2. Changing Appearances
        1. 12.3.2.1. Using the style Property
        2. 12.3.2.2. Changing the class Attribute
      3. 12.3.3. Positioning and Moving Content
      4. 12.3.4. Example: Animated Advertisement
        1. 12.3.4.1. Are We There Yet?
        2. 12.3.4.2. Performing the Animation
    4. 12.4. DOM and Events
      1. 12.4.1. DOM Event Handling
        1. 12.4.1.1. Accessing the Event Object
        2. 12.4.1.2. Using Event Data
      2. 12.4.2. Event Handling in Internet Explorer
        1. 12.4.2.1. Accessing the event Object
        2. 12.4.2.2. Using Event Data
    5. 12.5. Writing Cross-Browser DHTML
    6. 12.6. JavaScript and XML
      1. 12.6.1. Manipulating XML with JavaScript
      2. 12.6.2. Retrieving an XML File in IE
      3. 12.6.3. Retrieving an XML File in Firefox and Opera
      4. 12.6.4. Retrieving an XML File (Cross-Browser)
      5. 12.6.5. Example: Displaying a Daily Message
    7. 12.7. Summary
    8. 12.8. Exercise Questions
  18. 13. Using ActiveX and Plug-Ins with JavaScript
    1. 13.1. Checking for and Embedding Plug-ins (Non-IE Browsers)
      1. 13.1.1. Adding a Plug-in to the Page
      2. 13.1.2. Checking for and Installing Plug-ins
    2. 13.2. Checking for and Embedding ActiveX Controls on Internet Explorer
      1. 13.2.1. Adding an ActiveX Control to the Page
      2. 13.2.2. Installing an ActiveX Control
    3. 13.3. Using Plug-ins and ActiveX Controls
      1. 13.3.1. Determining Plug-in/ActiveX Control Availability
      2. 13.3.2. Finishing Up
      3. 13.3.3. Testing the Disabling of the Form
      4. 13.3.4. Potential Problems
        1. 13.3.4.1. Similar but Not the Same — Differences Among Browsers
        2. 13.3.4.2. Differences in the Scripting of Plug-ins
        3. 13.3.4.3. Differences Between Operating Systems
        4. 13.3.4.4. Differences Between Different Versions of the Same Plug-in or ActiveX Control
          1. 13.3.4.4.1. ActiveX Controls
          2. 13.3.4.4.2. Plug-ins
        5. 13.3.4.5. Changes to Internet Explorer 6 Service Pack 1b and ActiveX Controls
    4. 13.4. Summary
    5. 13.5. Exercise Question
  19. 14. Ajax
    1. 14.1. What Is Ajax?
      1. 14.1.1. What Can It Do?
        1. 14.1.1.1. Google Maps
        2. 14.1.1.2. Google Suggest
      2. 14.1.2. Browser Support
    2. 14.2. Using the XMLHttpRequest Object
      1. 14.2.1. Cross-Browser Issues
        1. 14.2.1.1. Using ActiveX
        2. 14.2.1.2. Calling the Native Constructor: The Other Browsers
        3. 14.2.1.3. Playing Together: One Function to Create them All
      2. 14.2.2. Using the XMLHttpRequest Object
      3. 14.2.3. Asynchronous Requests
    3. 14.3. Creating a Simple Ajax Module
      1. 14.3.1. Planning the HttpRequest Module
      2. 14.3.2. The HttpRequest Constructor
      3. 14.3.3. Creating the Methods
        1. 14.3.3.1. Cross-Browser XMLHttpRequest Creation . . . Again
        2. 14.3.3.2. Sending the Request
      4. 14.3.4. The Full Code
    4. 14.4. Validating Form Fields with Ajax
      1. 14.4.1. Requesting Information
      2. 14.4.2. The Received Data
      3. 14.4.3. Before You Begin
        1. 14.4.3.1. A Web Server
        2. 14.4.3.2. PHP
    5. 14.5. Things to Watch Out For
      1. 14.5.1. Security Issues
        1. 14.5.1.1. The Same-Origin Policy
        2. 14.5.1.2. ActiveX
      2. 14.5.2. Usability Concerns
        1. 14.5.2.1. The Browser's Back Button
        2. 14.5.2.2. Creating a Back/Forward-Capable Form with an IFrame
        3. 14.5.2.3. The Server Response
        4. 14.5.2.4. Dealing with Delays
        5. 14.5.2.5. Degrade Gracefully When Ajax Fails
    6. 14.6. Summary
    7. 14.7. Exercise Questions
  20. 15. JavaScript Frameworks
    1. 15.1. Picking a Framework to Work With
    2. 15.2. Getting Started
      1. 15.2.1. Installing the Frameworks
        1. 15.2.1.1. Downloading the Frameworks
        2. 15.2.1.2. Adding the Frameworks to Your Pages
      2. 15.2.2. Testing the Frameworks
        1. 15.2.2.1. Testing Your jQuery Installation
        2. 15.2.2.2. Testing Your Prototype Installation
        3. 15.2.2.3. Testing Your MooTools Installation
    3. 15.3. Digging Deeper Into jQuery
      1. 15.3.1. Selecting Elements
      2. 15.3.2. Changing Style
        1. 15.3.2.1. Using Multiple CSS classes
        2. 15.3.2.2. Using the toggleClass Method
        3. 15.3.2.3. Using the hasClass Method
      3. 15.3.3. Creating, Appending, and Removing Elements
        1. 15.3.3.1. Creating Elements
        2. 15.3.3.2. Appending Elements
        3. 15.3.3.3. Removing Elements
      4. 15.3.4. The jQuery Event Model and Handling Events
      5. 15.3.5. Rewriting the DHTML Toolbar with jQuery
      6. 15.3.6. Using jQuery for Ajax
        1. 15.3.6.1. Understanding the jQuery Function
        2. 15.3.6.2. Using jQuery's Ajax Event Handling
        3. 15.3.6.3. Sending Multiple Parameters
    4. 15.4. Diving into Prototype
      1. 15.4.1. Retrieving Elements
        1. 15.4.1.1. Selecting Elements With CSS Selectors
        2. 15.4.1.2. Performing an Operation on Elements Selected With $$()
      2. 15.4.2. Manipulating Style
      3. 15.4.3. Creating, Inserting, and Removing Elements
        1. 15.4.3.1. Creating an Element
        2. 15.4.3.2. Inserting an Element
        3. 15.4.3.3. Removing an Element
      4. 15.4.4. Using Events
      5. 15.4.5. Rewriting the DHTML Toolbar with Prototype
      6. 15.4.6. Using Ajax Support
    5. 15.5. Delving into MooTools
      1. 15.5.1. Finding Elements
      2. 15.5.2. Altering Style
      3. 15.5.3. Creating, Inserting, and Removing Elements
      4. 15.5.4. Using and Handling Events
      5. 15.5.5. Rewriting the DHTML Toolbar with MooTools
      6. 15.5.6. Ajax Support in MooTools
    6. 15.6. Summary
    7. 15.7. Exercise Questions
  21. A. Answers to Exercises
    1. A.1. Chapter 2
      1. A.1.1. Exercise 1 Question
      2. A.1.2. Exercise 1 Solution
      3. A.1.3. Exercise 2 Question
      4. A.1.4. Exercise 2 Solution
    2. A.2. Chapter 3
      1. A.2.1. Exercise 1 Question
      2. A.2.2. Exercise 1 Solution
      3. A.2.3. Exercise 2 Question
      4. A.2.4. Exercise 2 Solution
      5. A.2.5. Exercise 3 Question
      6. A.2.6. Exercise 3 Solution
      7. A.2.7. Exercise 4 Question
      8. A.2.8. Exercise 4 Solution
    3. A.3. Chapter 4
      1. A.3.1. Exercise 1 Question
      2. A.3.2. Exercise 1 Solution
      3. A.3.3. Exercise 2 Question
      4. A.3.4. Exercise 2 Solution
    4. A.4. Chapter 5
      1. A.4.1. Exercise 1 Question
      2. A.4.2. Exercise 1 Solution
      3. A.4.3. Exercise 2 Question
      4. A.4.4. Exercise 2 Solution
      5. A.4.5. Exercise 3 Question
      6. A.4.6. Exercise 3 Solution
    5. A.5. Chapter 6
      1. A.5.1. Exercise 1 Question
      2. A.5.2. Exercise 1 Solution
      3. A.5.3. Exercise 2 Question
      4. A.5.4. Exercise 2 Solution
      5. A.5.5. Exercise 3 Question
      6. A.5.6. Exercise 3 Solution
    6. A.6. Chapter 7
      1. A.6.1. Exercise 1 Question
      2. A.6.2. Exercise 1 Solution
      3. A.6.3. Exercise 2 Question
      4. A.6.4. Exercise 2 Solution
    7. A.7. Chapter 8
      1. A.7.1. Exercise 1 Question
      2. A.7.2. Exercise 1 Solution
      3. A.7.3. Exercise 2 Question
      4. A.7.4. Exercise 2 Solution
    8. A.8. Chapter 9
      1. A.8.1. Exercise 1 Question
      2. A.8.2. Exercise 1 Solution
      3. A.8.3. Exercise 2 Question
      4. A.8.4. Exercise 2 Solution
      5. A.8.5. Exercise 3 Question
      6. A.8.6. Exercise 3 Solution
    9. A.9. Chapter 10
      1. A.9.1. Exercise 1 Question
      2. A.9.2. Exercise 1 Solution
      3. A.9.3. Exercise 2 Question
      4. A.9.4. Exercise 2 Solution
    10. A.10. Chapter 11
      1. A.10.1. Exercise 1 Question
      2. A.10.2. Exercise 1 Solution
      3. A.10.3. Exercise 2 Question
      4. A.10.4. Exercise 2 Solution
    11. A.11. Chapter 12
      1. A.11.1. Exercise 1 Question
      2. A.11.2. Exercise 2 Solution
      3. A.11.3. Exercise 2 Question
      4. A.11.4. Exercise 2 Solution
    12. A.12. Chapter 13
      1. A.12.1. Exercise 1 Question
      2. A.12.2. Exercise 1 Solution
    13. A.13. Chapter 14
      1. A.13.1. Exercise 1 Question
      2. A.13.2. Exercise 1 Solution
      3. A.13.3. Exercise 2 Question
      4. A.13.4. Exercise 2 Solution
    14. A.14. Chapter 15
      1. A.14.1. Exercise 1 Question
      2. A.14.2. Exercise 1 Solution
      3. A.14.3. Exercise 2 Question
      4. A.14.4. Exercise 2 Solution
      5. A.14.5. Exercise 3 Question
      6. A.14.6. Exercise 3 Solution
  22. B. JavaScript Core Reference
    1. B.1. Browser Reference
    2. B.2. Reserved Words
      1. B.2.1. Other Identifiers to Avoid
        1. B.2.1.1. JavaScript 1.0
        2. B.2.1.2. JavaScript 1.1
        3. B.2.1.3. JavaScript 1.2
        4. B.2.1.4. JavaScript 1.3
    3. B.3. JavaScript Operators
      1. B.3.1. Assignment Operators
      2. B.3.2. Comparison Operators
      3. B.3.3. Arithmetic Operators
      4. B.3.4. Bitwise Operators
      5. B.3.5. Bitwise Shift Operators
      6. B.3.6. Logical Operators
        1. B.3.6.1. Object Operators
      7. B.3.7. Miscellaneous_Operators
      8. B.3.8. Operator Precedence
    4. B.4. JavaScript Statements
      1. B.4.1. Block
      2. B.4.2. Conditional
      3. B.4.3. Declarations
      4. B.4.4. Loop
      5. B.4.5. Execution Control Statements
      6. B.4.6. Exception Handling Statements
      7. B.4.7. Other Statements
    5. B.5. Top-Level Properties and Functions
    6. B.6. JavaScript and Jscript Core Objects
      1. B.6.1. ActiveXObject
      2. B.6.2. Array
      3. B.6.3. Boolean
      4. B.6.4. Date
      5. B.6.5. Function
      6. B.6.6. Math
      7. B.6.7. Number
      8. B.6.8. Object
      9. B.6.9. RegExp
      10. B.6.10. String
  23. C. W3C DOM Reference
    1. C.1. DOM Core Objects
      1. C.1.1. Low-Level DOM Objects
        1. C.1.1.1. Node
        2. C.1.1.2. NodeList
        3. C.1.1.3. NamedNodeMap
      2. C.1.2. High-Level DOM Objects
        1. C.1.2.1. Attr
        2. C.1.2.2. Document
        3. C.1.2.3. DocumentFragment
        4. C.1.2.4. Element
        5. C.1.2.5. Text
    2. C.2. HTML DOM Objects
      1. C.2.1. Miscellaneous Objects: The HTML Collection
      2. C.2.2. HTML Document Objects: The HTML Document
      3. C.2.3. HTML Element Objects
        1. C.2.3.1. HTMLElement
        2. C.2.3.2. HTMLAnchorElement
        3. C.2.3.3. HTMLBodyElement
      4. C.2.4. HTMLButtonElement
        1. C.2.4.1. HTMLDivElement
        2. C.2.4.2. HTMLFormElement
        3. C.2.4.3. HTMLFrameElement
        4. C.2.4.4. HTMLFrameSetElement
        5. C.2.4.5. HTMLIFrameElement
        6. C.2.4.6. HTMLImageElement
        7. C.2.4.7. HTMLInputElement
        8. C.2.4.8. HTMLOptionElement
        9. C.2.4.9. HTMLOptionCollection
        10. C.2.4.10. HTMLParagraphElement
        11. C.2.4.11. HTMLSelectElement
        12. C.2.4.12. HTMLTableCellElement
        13. C.2.4.13. HTMLTableElement
        14. C.2.4.14. HTMLTableRowElement
        15. C.2.4.15. HTMLTableSectionElement
        16. C.2.4.16. HTMLTextAreaElement
    3. C.3. DOM Event Model and Objects
      1. C.3.1. EventTarget
      2. C.3.2. Event
      3. C.3.3. MouseEvent
    4. C.4. Miscellaneous Events
  24. D. Latin-1 Character Set

Product information

  • Title: Beginning JavaScript®, Fourth Edition
  • Author(s): Paul Wilton, Jeremy McPeak
  • Release date: October 2009
  • Publisher(s): Wrox
  • ISBN: 9780470525937