| |
| |
Preface | |
| |
| |
| |
Introduction to JavaScript | |
| |
| |
| |
What Is JavaScript? | |
| |
| |
| |
Versions of JavaScript | |
| |
| |
| |
Client-Side JavaScript | |
| |
| |
| |
JavaScript in Other Contexts | |
| |
| |
| |
Exploring JavaScript | |
| |
| |
| |
Core JavaScript | |
| |
| |
| |
Lexical Structure | |
| |
| |
| |
Character Set | |
| |
| |
| |
Case Sensitivity | |
| |
| |
| |
Whitespace and Line Breaks | |
| |
| |
| |
Optional Semicolons | |
| |
| |
| |
Comments | |
| |
| |
| |
Literals | |
| |
| |
| |
Identifiers | |
| |
| |
| |
Reserved Words | |
| |
| |
| |
Datatypes and Values | |
| |
| |
| |
Numbers | |
| |
| |
| |
Strings | |
| |
| |
| |
Boolean Values | |
| |
| |
| |
Functions | |
| |
| |
| |
Objects | |
| |
| |
| |
Arrays | |
| |
| |
| |
null | |
| |
| |
| |
undefined | |
| |
| |
| |
The Date Object | |
| |
| |
| |
Regular Expressions | |
| |
| |
| |
Error Objects | |
| |
| |
| |
Type Conversion Summary | |
| |
| |
| |
Primitive Datatype Wrapper Objects | |
| |
| |
| |
Object-to-Primitive Conversion | |
| |
| |
| |
By Value Versus by Reference | |
| |
| |
| |
Variables | |
| |
| |
| |
Variable Typing | |
| |
| |
| |
Variable Declaration | |
| |
| |
| |
Variable Scope | |
| |
| |
| |
Primitive Types and Reference Types | |
| |
| |
| |
Garbage Collection | |
| |
| |
| |
Variables as Properties | |
| |
| |
| |
Variable Scope Revisited | |
| |
| |
| |
Expressions and Operators | |
| |
| |
| |
Expressions | |
| |
| |
| |
Operator Overview | |
| |
| |
| |
Arithmetic Operators | |
| |
| |
| |
Equality Operators | |
| |
| |
| |
Relational Operators | |
| |
| |
| |
String Operators | |
| |
| |
| |
Logical Operators | |
| |
| |
| |
Bitwise Operators | |
| |
| |
| |
Assignment Operators | |
| |
| |
| |
Miscellaneous Operators | |
| |
| |
| |
Statements | |
| |
| |
| |
Expression Statements | |
| |
| |
| |
Compound Statements | |
| |
| |
| |
if | |
| |
| |
| |
else if | |
| |
| |
| |
switch | |
| |
| |
| |
while | |
| |
| |
| |
do/while | |
| |
| |
| |
for | |
| |
| |
| |
for/in | |
| |
| |
| |
Labels | |
| |
| |
| |
break | |
| |
| |
| |
continue | |
| |
| |
| |
var | |
| |
| |
| |
function | |
| |
| |
| |
return | |
| |
| |
| |
throw | |
| |
| |
| |
try/catch/finally | |
| |
| |
| |
with | |
| |
| |
| |
The Empty Statement | |
| |
| |
| |
Summary of JavaScript Statements | |
| |
| |
| |
Objects and Arrays | |
| |
| |
| |
Creating Objects | |
| |
| |
| |
Object Properties | |
| |
| |
| |
Objects as Associative Arrays | |
| |
| |
| |
Universal Object Properties and Methods | |
| |
| |
| |
Arrays | |
| |
| |
| |
Reading and Writing Array Elements | |
| |
| |
| |
Array Methods | |
| |
| |
| |
Array-Like Objects | |
| |
| |
| |
Functions | |
| |
| |
| |
Defining and Invoking Functions | |
| |
| |
| |
Function Arguments | |
| |
| |
| |
Functions as Data | |
| |
| |
| |
Functions as Methods | |
| |
| |
| |
Constructor Functions | |
| |
| |
| |
Function Properties and Methods | |
| |
| |
| |
Utility Function Examples | |
| |
| |
| |
Function Scope and Closures | |
| |
| |
| |
The Function() Constructor | |
| |
| |
| |
Classes, Constructors, and Prototypes | |
| |
| |
| |
Constructors | |
| |
| |
| |
Prototypes and Inheritance | |
| |
| |
| |
Simulating Classes in JavaScript | |
| |
| |
| |
Common Object Methods | |
| |
| |
| |
Superclasses and Subclasses | |
| |
| |
| |
Extending Without Inheriting | |
| |
| |
| |
Determining Object Type | |
| |
| |
| |
Example: A defineClass() Utility Method | |
| |
| |
| |
Modules and Namespaces | |
| |
| |
| |
Creating Modules and Namespaces | |
| |
| |
| |
Importing Symbols from Namespaces | |
| |
| |
| |
Module Utilities | |
| |
| |
| |
Pattern Matching with Regular Expressions | |
| |
| |
| |
Defining Regular Expressions | |
| |
| |
| |
String Methods for Pattern Matching | |
| |
| |
| |
The RegExp Object | |
| |
| |
| |
Scripting Java | |
| |
| |
| |
Embedding JavaScript | |
| |
| |
| |
Scripting Java | |
| |
| |
| |
Client-Side JavaScript | |
| |
| |
| |
JavaScript in Web Browsers | |
| |
| |
| |
The Web Browser Environment | |
| |
| |
| |
Embedding Scripts in HTML | |
| |
| |
| |
Event Handlers in HTML | |
| |
| |
| |
JavaScript in URLs | |
| |
| |
| |
Execution of JavaScript Programs | |
| |
| |
| |
Client-Side Compatibility | |
| |
| |
| |
Accessibility | |
| |
| |
| |
JavaScript Security | |
| |
| |
| |
Other Web-Related JavaScript Embeddings | |
| |
| |
| |
Scripting Browser Windows | |
| |
| |
| |
Timers | |
| |
| |
| |
Browser Location and History | |
| |
| |
| |
Obtaining Window, Screen, and Browser Information | |
| |
| |
| |
Opening and Manipulating Windows | |
| |
| |
| |
Simple Dialog Boxes | |
| |
| |
| |
Scripting the Status Line | |
| |
| |
| |
Error Handling | |
| |
| |
| |
Multiple Windows and Frames | |
| |
| |
| |
Example: A Navigation Bar in a Frame | |
| |
| |
| |
Scripting Documents | |
| |
| |
| |
Dynamic Document Content | |
| |
| |
| |
Document Properties | |
| |
| |
| |
Legacy DOM: Document Object Collections | |
| |
| |
| |
Overview of the W3C DOM | |
| |
| |
| |
Traversing a Document | |
| |
| |
| |
Finding Elements in a Document | |
| |
| |
| |
Modifying a Document | |
| |
| |
| |
Adding Content to a Document | |
| |
| |
| |
Example: A Dynamically Created Table of Contents | |
| |
| |
| |
Querying Selected Text | |
| |
| |
| |
The IE 4 DOM | |
| |
| |
| |
Cascading Style Sheets and Dynamic HTML | |
| |
| |
| |
Overview of CSS | |
| |
| |
| |
CSS for DHTML | |
| |
| |
| |
Scripting Inline Styles | |
| |
| |
| |
Scripting Computed Styles | |
| |
| |
| |
Scripting CSS Classes | |
| |
| |
| |
Scripting Stylesheets | |
| |
| |
| |
Events and Event Handling | |
| |
| |
| |
Basic Event Handling | |
| |
| |
| |
Advanced Event Handling with DOM Level 2 | |
| |
| |
| |
The Internet Explorer Event Model | |
| |
| |
| |
Mouse Events | |
| |
| |
| |
Key Events | |
| |
| |
| |
The onload Event | |
| |
| |
| |
Synthetic Events | |
| |
| |
| |
Forms and Form Elements | |
| |
| |
| |
The Form Object | |
| |
| |
| |
Defining Form Elements | |
| |
| |
| |
Scripting Form Elements | |
| |
| |
| |
Form Verification Example | |
| |
| |
| |
Cookies and Client-Side Persistence | |
| |
| |
| |
An Overview of Cookies | |
| |
| |
| |
Storing Cookies | |
| |
| |
| |
Reading Cookies | |
| |
| |
| |
Cookie Example | |
| |
| |
| |
Cookie Alternatives | |
| |
| |
| |
Persistent Data and Security | |
| |
| |
| |
Scripting HTTP | |
| |
| |
| |
Using XMLHttpRequest | |
| |
| |
| |
XMLHttpRequest Examples and Utilities | |
| |
| |
| |
Ajax and Dynamic Scripting | |
| |
| |
| |
Scripting HTTP with [left angle bracket]script[right angle bracket] Tags | |
| |
| |
| |
JavaScript and XML | |
| |
| |
| |
Obtaining XML Documents | |
| |
| |
| |
Manipulating XML with the DOM API | |
| |
| |
| |
Transforming XML with XSLT | |
| |
| |
| |
Querying XML with XPath | |
| |
| |
| |
Serializing XML | |
| |
| |
| |
Expanding HTML Templates with XML Data | |
| |
| |
| |
XML and Web Services | |
| |
| |
| |
E4X: ECMAScript for XML | |
| |
| |
| |
Scripted Client-Side Graphics | |
| |
| |
| |
Scripting Images | |
| |
| |
| |
Graphics with CSS | |
| |
| |
| |
SVG: Scalable Vector Graphics | |
| |
| |
| |
VML: Vector Markup Language | |
| |
| |
| |
Graphics in a [left angle bracket]canvas[right angle bracket] | |
| |
| |
| |
Graphics with Flash | |
| |
| |
| |
Graphics with Java | |
| |
| |
| |
Scripting Java Applets and Flash Movies | |
| |
| |
| |
Scripting Applets | |
| |
| |
| |
Scripting the Java Plug-in | |
| |
| |
| |
Scripting with Java | |
| |
| |
| |
Scripting Flash | |
| |
| |
| |
Scripting Flash 8 | |
| |
| |
| |
Core JavaScript Reference | |
| |
| |
Core JavaScript Reference | |
| |
| |
| |
Client-Side JavaScript Reference | |
| |
| |
Client-Side JavaScript Reference | |
| |
| |
Index | |