Preface
1. Introduction to JavaScript
1.
1 What Is JavaScript?
1.
2 Versions of JavaScript
1.
3 Client-Side JavaScript
1.
4 JavaScript in Other Contexts
1.
5 Exploring JavaScript
Part I. Core JavaScript
2. Lexical Structure
2.
1 Character Set
2.
2 Case Sensitivity
2.
3 Whitespace and Line Breaks
2.
4 Optional Semicolons
2.
5 Comments
2.
6 Literals
2.
7 Identifiers
2.
8 Reserved Words
3. Datatypes and Values
3.
1 Numbers
3.
2 Strings
3.
3 Boolean Values
3.
4 Functions
3.
5 Objects
3.
6 Arrays
3.
7 null
3.
8 undefined
3.
9 The Date Object
3.
10 Regular Expressions
3.
11 Error Objects
3.
12 Type Conversion Summary
3.
13 Primitive Datatype Wrapper Objects
3.
14 Object-to-Primitive Conversion
3.
15 By Value Versus by Reference
4. Variables
4.
1 Variable Typing
4.
2 Variable Declaration
4.
3 Variable Scope
4.
4 Primitive Types and Reference Types
4.
5 Garbage Collection
4.
6 Variables as Properties
4.
7 Variable Scope Revisited
5. Expressions and Operators
5.
1 Expressions
5.
2 Operator Overview
5.
3 Arithmetic Operators
5.
4 Equality Operators
5.
5 Relational Operators
5.
6 String Operators
5.
7 Logical Operators
5.
8 Bitwise Operators
5.
9 Assignment Operators
5.
10 Miscellaneous Operators
6. Statements
6.
1 Expression Statements
6.
2 Compound Statements
6.
3 if
6.
4 else if
6.
5 switch
6.
6 while
6.
7 do/while
6.
8 for
6.
9 for/in
6.
10 Labels
6.
11 break
6.
12 continue
6.
13 var
6.
14 function
6.
15 return
6.
16 throw
6.
17 try/catch/finally
6.
18 with
6.
19 The Empty Statement
6.
20 Summary of JavaScript Statements
7. Objects and Arrays
7.
1 Creating Objects
7.
2 Object Properties
7.
3 Objects as Associative Arrays
7.
4 Universal Object Properties and Methods
7.
5 Arrays
7.
6 Reading and Writing Array Elements
7.
7 Array Methods
7.
8 Array-Like Objects
8. Functions
8.
1 Defining and Invoking Functions
8.
2 Function Arguments
8.
3 Functions as Data
8.
4 Functions as Methods
8.
5 Constructor Functions
8.
6 Function Properties and Methods
8.
7 Utility Function Examples
8.
8 Function Scope and Closures
8.
9 The Function( ) Constructor
9. Classes, Constructors, and Prototypes
9.
1 Constructors
9.
2 Prototypes and Inheritance
9.
3 Simulating Classes in JavaScript
9.
4 Common Object Methods
9.
5 Superclasses and Subclasses
9.
6 Extending Without Inheriting
9.
7 Determining Object Type
9.
8 Example: A defineClass( ) Utility Method
10. Modules and Namespaces
10.
1 Creating Modules and Namespaces
10.
2 Importing Symbols from Namespaces
10.
3 Module Utilities
11. Pattern Matching with Regular Expressions
11.
1 Defining Regular Expressions
11.
2 String Methods for Pattern Matching
11.
3 The RegExp Object
12. Scripting Java
12.
1 Embedding JavaScript
12.
2 Scripting Java
Part II. Client-Side JavaScript
13. JavaScript in Web Browsers
13.
1 The Web Browser Environment
13.
2 Embedding Scripts in HTML
13.
3 Event Handlers in HTML
13.
4 JavaScript in URLs
13.
5 Execution of JavaScript Programs
13.
6 Client-Side Compatibility
13.
7 Accessibility
13.
8 JavaScript Security
13.
9 Other Web-Related JavaScript Embeddings
14. Scripting Browser Windows
14.
1 Timers
14.
2 Browser Location and History
14.
3 Obtaining Window, Screen, and Browser Information
14.
4 Opening and Manipulating Windows
14.
5 Simple Dialog Boxes
14.
6 Scripting the Status Line
14.
7 Error Handling
14.
8 Multiple Windows and Frames
14.
9 Example: A Navigation Bar in a Frame
15. Scripting Documents
15.
1 Dynamic Document Content
15.
2 Document Properties
15.
3 Legacy DOM: Document Object Collections
15.
4 Overview of the W3C DOM
15.
5 Traversing a Document
15.
6 Finding Elements in a Document
15.
7 Modifying a Document
15.
8 Adding Content to a Document
15.
9 Example: A Dynamically Created Table of Contents
15.
10 Querying Selected Text
15.
11 The IE 4 DOM
16. Cascading Style Sheets and Dynamic HTML
16.
1 Overview of CSS
16.
2 CSS for DHTML
16.
3 Scripting Inline Styles
16.
4 Scripting Computed Styles
16.
5 Scripting CSS Classes
16.
6 Scripting Stylesheets
17. Events and Event Handling
17.
1 Basic Event Handling
17.
2 Advanced Event Handling with DOM Level 2
17.
3 The Internet Explorer Event Model
17.
4 Mouse Events