| Preface |
|
xv | |
|
Introduction to JavaScript |
|
|
1 | (14) |
|
|
|
2 | (1) |
|
|
|
2 | (2) |
|
|
|
4 | (5) |
|
JavaScript in Other Contexts |
|
|
9 | (1) |
|
|
|
10 | (5) |
|
|
|
|
|
|
15 | (6) |
|
|
|
15 | (1) |
|
|
|
16 | (1) |
|
Whitespace and Line Breaks |
|
|
16 | (1) |
|
|
|
16 | (1) |
|
|
|
17 | (1) |
|
|
|
17 | (1) |
|
|
|
18 | (1) |
|
|
|
19 | (2) |
|
|
|
21 | (28) |
|
|
|
22 | (3) |
|
|
|
25 | (6) |
|
|
|
31 | (1) |
|
|
|
32 | (1) |
|
|
|
33 | (2) |
|
|
|
35 | (2) |
|
|
|
37 | (1) |
|
|
|
37 | (1) |
|
|
|
38 | (1) |
|
|
|
38 | (1) |
|
|
|
39 | (1) |
|
|
|
39 | (1) |
|
Primitive Datatype Wrapper Objects |
|
|
40 | (2) |
|
Object-to-Primitive Conversion |
|
|
42 | (1) |
|
By Value Versus by Reference |
|
|
43 | (6) |
|
|
|
49 | (10) |
|
|
|
49 | (1) |
|
|
|
50 | (1) |
|
|
|
51 | (2) |
|
Primitive Types and Reference Types |
|
|
53 | (2) |
|
|
|
55 | (1) |
|
|
|
56 | (1) |
|
|
|
57 | (2) |
|
Expressions and Operators |
|
|
59 | (24) |
|
|
|
59 | (1) |
|
|
|
60 | (3) |
|
|
|
63 | (2) |
|
|
|
65 | (3) |
|
|
|
68 | (2) |
|
|
|
70 | (1) |
|
|
|
71 | (2) |
|
|
|
73 | (2) |
|
|
|
75 | (2) |
|
|
|
77 | (6) |
|
|
|
83 | (23) |
|
|
|
83 | (1) |
|
|
|
84 | (1) |
|
|
|
85 | (2) |
|
|
|
87 | (1) |
|
|
|
87 | (3) |
|
|
|
90 | (1) |
|
|
|
91 | (1) |
|
|
|
91 | (2) |
|
|
|
93 | (1) |
|
|
|
94 | (1) |
|
|
|
94 | (2) |
|
|
|
96 | (1) |
|
|
|
97 | (1) |
|
|
|
97 | (2) |
|
|
|
99 | (1) |
|
|
|
99 | (1) |
|
|
|
100 | (2) |
|
|
|
102 | (1) |
|
|
|
103 | (1) |
|
Summary of JavaScript Statements |
|
|
104 | (2) |
|
|
|
106 | (18) |
|
|
|
106 | (1) |
|
|
|
107 | (2) |
|
Objects as Associative Arrays |
|
|
109 | (2) |
|
Universal Object Properties and Methods |
|
|
111 | (2) |
|
|
|
113 | (1) |
|
Reading and Writing Array Elements |
|
|
114 | (4) |
|
|
|
118 | (4) |
|
|
|
122 | (2) |
|
|
|
124 | (26) |
|
Defining and Invoking Functions |
|
|
124 | (4) |
|
|
|
128 | (6) |
|
|
|
134 | (2) |
|
|
|
136 | (1) |
|
|
|
137 | (1) |
|
Function Properties and Methods |
|
|
137 | (2) |
|
Utility Function Examples |
|
|
139 | (2) |
|
Function Scope and Closures |
|
|
141 | (7) |
|
The Function() Constructor |
|
|
148 | (2) |
|
Classes, Constructors, and Prototypes |
|
|
150 | (33) |
|
|
|
150 | (1) |
|
Prototypes and Inheritance |
|
|
151 | (6) |
|
Simulating Classes in JavaScript |
|
|
157 | (7) |
|
|
|
164 | (3) |
|
Superclasses and Subclasses |
|
|
167 | (4) |
|
Extending Without Inheriting |
|
|
171 | (3) |
|
|
|
174 | (5) |
|
Example: A defineClass( ) Utility Method |
|
|
179 | (4) |
|
|
|
183 | (16) |
|
Creating Modules and Namespaces |
|
|
184 | (5) |
|
Importing Symbols from Namespaces |
|
|
189 | (3) |
|
|
|
192 | (7) |
|
Pattern Matching with Regular Expressions |
|
|
199 | (14) |
|
Defining Regular Expressions |
|
|
199 | (9) |
|
String Methods for Pattern Matching |
|
|
208 | (2) |
|
|
|
210 | (3) |
|
|
|
213 | (22) |
|
|
|
213 | (8) |
|
|
|
221 | (14) |
|
Part II. Client-Side JavaScript |
|
|
|
JavaScript in Web Browsers |
|
|
235 | (35) |
|
The Web Browser Environment |
|
|
236 | (6) |
|
Embedding Scripts in HTML |
|
|
242 | (6) |
|
|
|
248 | (2) |
|
|
|
250 | (2) |
|
Execution of JavaScript Programs |
|
|
252 | (4) |
|
Client-Side Compatibility |
|
|
256 | (6) |
|
|
|
262 | (1) |
|
|
|
263 | (5) |
|
Other Web-Related JavaScript Embeddings |
|
|
268 | (2) |
|
Scripting Browser Windows |
|
|
270 | (28) |
|
|
|
271 | (1) |
|
Browser Location and History |
|
|
272 | (2) |
|
Obtaining Window, Screen, and Browser Information |
|
|
274 | (6) |
|
Opening and Manipulating Windows |
|
|
280 | (5) |
|
|
|
285 | (1) |
|
Scripting the Status Line |
|
|
286 | (2) |
|
|
|
288 | (1) |
|
Multiple Windows and Frames |
|
|
289 | (6) |
|
Example: A Navigation Bar in a Frame |
|
|
295 | (3) |
|
|
|
298 | (47) |
|
|
|
299 | (2) |
|
|
|
301 | (2) |
|
Legacy DOM: Document Object Collections |
|
|
303 | (4) |
|
|
|
307 | (11) |
|
|
|
318 | (2) |
|
Finding Elements in a Document |
|
|
320 | (4) |
|
|
|
324 | (4) |
|
Adding Content to a Document |
|
|
328 | (8) |
|
Example: A Dynamically Created Table of Contents |
|
|
336 | (5) |
|
|
|
341 | (1) |
|
|
|
342 | (3) |
|
Cascading Style Sheets and Dynamic HTML |
|
|
345 | (43) |
|
|
|
346 | (9) |
|
|
|
355 | (16) |
|
|
|
371 | (9) |
|
Scripting Computed Styles |
|
|
380 | (1) |
|
|
|
381 | (1) |
|
|
|
382 | (6) |
|
Events and Event Handling |
|
|
388 | (49) |
|
|
|
389 | (10) |
|
Advanced Event Handling with DOM Level 2 |
|
|
399 | (10) |
|
The Internet Explorer Event Model |
|
|
409 | (10) |
|
|
|
419 | (6) |
|
|
|
425 | (8) |
|
|
|
433 | (2) |
|
|
|
435 | (2) |
|
|
|
437 | (19) |
|
|
|
438 | (1) |
|
|
|
439 | (4) |
|
|
|
443 | (8) |
|
Form Verification Example |
|
|
451 | (5) |
|
Cookies and Client-Side Persistence |
|
|
456 | (22) |
|
|
|
456 | (3) |
|
|
|
459 | (1) |
|
|
|
460 | (1) |
|
|
|
461 | (4) |
|
|
|
465 | (11) |
|
Persistent Data and Security |
|
|
476 | (2) |
|
|
|
478 | (24) |
|
|
|
479 | (6) |
|
XMLHttpRequest Examples and Utilities |
|
|
485 | (8) |
|
Ajax and Dynamic Scripting |
|
|
493 | (6) |
|
Scripting HTTP with <script> Tags |
|
|
499 | (3) |
|
|
|
502 | (28) |
|
|
|
502 | (6) |
|
Manipulating XML with the DOM API |
|
|
508 | (4) |
|
Transforming XML with XSLT |
|
|
512 | (3) |
|
|
|
515 | (5) |
|
|
|
520 | (1) |
|
Expanding HTML Templates with XML Data |
|
|
520 | (4) |
|
|
|
524 | (3) |
|
|
|
527 | (3) |
|
Scripted Client-Side Graphics |
|
|
530 | (43) |
|
|
|
531 | (8) |
|
|
|
539 | (8) |
|
SVG: Scalable Vector Graphics |
|
|
547 | (6) |
|
VML: Vector Markup Language |
|
|
553 | (4) |
|
|
|
557 | (3) |
|
|
|
560 | (5) |
|
|
|
565 | (8) |
|
Scripting Java Applets and Flash Movies |
|
|
573 | (378) |
|
|
|
574 | (2) |
|
Scripting the Java Plug-in |
|
|
576 | (2) |
|
|
|
578 | (4) |
|
|
|
582 | (7) |
|
|
|
589 | (6) |
|
Part III. Core JavaScript Reference |
|
|
|
Core JavaScript Reference |
|
|
595 | (122) |
|
Part IV. Client-Side JavaScript Reference |
|
|
|
Client-Side JavaScript Reference |
|
|
717 | (234) |
| Index |
|
951 | |