| Preface |
|
xix | (8) |
| Acknowledgements |
|
xxvii | |
|
|
|
1 | (14) |
|
What's New in JavaScript 1.2 |
|
|
1 | (11) |
|
|
|
2 | (1) |
|
|
|
3 | (1) |
|
|
|
3 | (1) |
|
|
|
3 | (1) |
|
|
|
4 | (1) |
|
|
|
4 | (1) |
|
|
|
5 | (2) |
|
New Properties, Methods, and Event Handlers for the window Object |
|
|
7 | (2) |
|
New Properties, Methods, and Event Handlers for Other Objects |
|
|
9 | (3) |
|
What's New in JavaScript 1.3 |
|
|
12 | (1) |
|
|
|
12 | (1) |
|
|
|
12 | (1) |
|
|
|
13 | (1) |
|
|
|
13 | (2) |
|
Chapter 2 Core Language Changes |
|
|
15 | (64) |
|
|
|
16 | (14) |
|
Comparison Operators (==.!=) |
|
|
16 | (11) |
|
|
|
27 | (3) |
|
|
|
30 | (21) |
|
|
|
30 | (2) |
|
|
|
32 | (3) |
|
|
|
35 | (5) |
|
|
|
40 | (8) |
|
|
|
48 | (2) |
|
|
|
50 | (1) |
|
|
|
51 | (1) |
|
|
|
51 | (22) |
|
|
|
51 | (7) |
|
|
|
58 | (9) |
|
|
|
67 | (3) |
|
|
|
70 | (3) |
|
Literal Notation for Creating Objects |
|
|
73 | (6) |
|
|
|
79 | (52) |
|
|
|
81 | (5) |
|
|
|
86 | (1) |
|
|
|
86 | (6) |
|
Specifying a Style for an Individual HTML Tag |
|
|
92 | (1) |
|
Importing an External Style Sheet with the [Link] Tag |
|
|
93 | (3) |
|
Importing an External Style Sheet by Using the SRC Attribute of the [STYLE] Tag |
|
|
96 | (2) |
|
Importing a Style Sheet by Using the CSS @import Notation |
|
|
98 | (2) |
|
|
|
100 | (3) |
|
|
|
101 | (1) |
|
Controlling the Style of Child Elements |
|
|
102 | (1) |
|
Marking a Section of Text for a Style |
|
|
103 | (1) |
|
Defining Classes of Styles |
|
|
104 | (3) |
|
Defining Named Individual Styles |
|
|
107 | (2) |
|
Defining Contextual Selection Criteria |
|
|
109 | (2) |
|
|
|
111 | (11) |
|
Comments in JavaScript Style Sheets |
|
|
111 | (1) |
|
JavaScript Style Sheet Syntax |
|
|
111 | (1) |
|
Combining Style Elements in a Group |
|
|
112 | (1) |
|
Specifying a Style for an HTML Tag |
|
|
113 | (1) |
|
Importing an External Style Sheet |
|
|
113 | (1) |
|
Importing a Style Sheet by Using the SRC Attribute of the [STYLE] Tag |
|
|
114 | (1) |
|
|
|
115 | (1) |
|
Marking a Section of Text for Style |
|
|
116 | (1) |
|
Defining Classes of Styles |
|
|
117 | (1) |
|
Defining Named Individual Styles |
|
|
118 | (1) |
|
Defining Contextual Selection Criteria |
|
|
119 | (1) |
|
Combining Style Sheet Syntaxes |
|
|
120 | (2) |
|
Pseudoclasses and Pseudoelements |
|
|
122 | (3) |
|
Using the Anchor Pseudoclass |
|
|
122 | (3) |
|
Combining Style Sheet Syntaxes |
|
|
125 | (6) |
|
Chapter 4 Positioning HTML Content |
|
|
131 | (40) |
|
Choosing a Positioning Format |
|
|
132 | (1) |
|
|
|
133 | (1) |
|
|
|
134 | (26) |
|
|
|
136 | (1) |
|
|
|
137 | (5) |
|
Positioning a Layer by Using the STYLE Attribute |
|
|
142 | (1) |
|
Identifying Layers by Name |
|
|
143 | (1) |
|
Controlling the Width of Layers |
|
|
143 | (3) |
|
Controlling the Height of Layers |
|
|
146 | (2) |
|
|
|
148 | (1) |
|
Controlling the Visibility of Layers |
|
|
149 | (2) |
|
Specifying the Background Color of Layers |
|
|
151 | (1) |
|
Specifying the Background Image of Layers |
|
|
152 | (3) |
|
Including Externally Specified Layers |
|
|
155 | (2) |
|
Controlling the Stacking Order of Layers |
|
|
157 | (3) |
|
|
|
160 | (11) |
|
|
|
162 | (1) |
|
|
|
162 | (1) |
|
Identifying Layers by Name |
|
|
163 | (1) |
|
Controlling the Width of Layers |
|
|
163 | (1) |
|
Controlling the Height of Layers |
|
|
164 | (1) |
|
|
|
165 | (1) |
|
Controlling the Visibility of Layers |
|
|
166 | (1) |
|
Specifying the Background Color of Layers |
|
|
167 | (1) |
|
Specifying the Background Image of Layers |
|
|
167 | (1) |
|
Including Externally Specified Layers |
|
|
168 | (1) |
|
Controlling the Stacking Order of Layers |
|
|
168 | (3) |
|
Chapter 5 Dynamic and Downloadable Fonts |
|
|
171 | (10) |
|
A Word About On-line Fonts |
|
|
172 | (2) |
|
|
|
172 | (1) |
|
|
|
173 | (1) |
|
|
|
173 | (1) |
|
Introducing Dynamic Fonts |
|
|
174 | (1) |
|
How to Use Downloadable Fonts |
|
|
175 | (6) |
|
Linking the Font Definition into the Document |
|
|
176 | (1) |
|
Using the Font Definition |
|
|
177 | (2) |
|
Specifying the PFR MIME Type on the Server |
|
|
179 | (2) |
|
|
|
181 | (54) |
|
|
|
182 | (2) |
|
|
|
182 | (1) |
|
DHTML Functionality and Features |
|
|
183 | (1) |
|
Problems with Cross-Browser Scripting |
|
|
183 | (1) |
|
The JavaScript layer Object |
|
|
184 | (10) |
|
|
|
187 | (1) |
|
Referencing the Layer's Document |
|
|
187 | (1) |
|
Referencing the Layer's Source Document |
|
|
187 | (1) |
|
|
|
188 | (1) |
|
Setting the Background Color or Image of a Layer |
|
|
189 | (1) |
|
|
|
190 | (1) |
|
|
|
191 | (1) |
|
|
|
191 | (2) |
|
Capturing and Releasing Events |
|
|
193 | (1) |
|
Changing the Source of a Layer |
|
|
194 | (1) |
|
layer Object Event Handlers |
|
|
194 | (5) |
|
Using Event Handlers to Control Window Focus |
|
|
195 | (1) |
|
Using Event Handlers on Load |
|
|
196 | (1) |
|
Capturing Events on Mouse Out and on Mouse Up |
|
|
197 | (2) |
|
|
|
199 | (36) |
|
Chapter 7 Regular Expressions |
|
|
235 | (26) |
|
Creating a Regular Expression |
|
|
236 | (1) |
|
|
|
236 | (1) |
|
|
|
236 | (1) |
|
RegExp Constructor Function |
|
|
236 | (1) |
|
|
|
237 | (4) |
|
|
|
237 | (4) |
|
|
|
241 | (13) |
|
Getting Remembered Substring Matches |
|
|
242 | (1) |
|
Determining If the Global Flag Is Set |
|
|
243 | (1) |
|
Determining If Case Sensitivity Is Set |
|
|
243 | (1) |
|
Setting the Matching String |
|
|
243 | (1) |
|
Getting the Index to Start the Next Match |
|
|
244 | (1) |
|
|
|
244 | (1) |
|
Getting the Last Parenthesized Substring Match |
|
|
245 | (1) |
|
Getting the Substring Preceding the Most Recent Match |
|
|
245 | (1) |
|
Determining Whether to Search Across Multiple Lines |
|
|
245 | (1) |
|
Getting the Substring Following the Most Recent Match |
|
|
246 | (1) |
|
Getting the Text of the Pattern |
|
|
246 | (1) |
|
Compiling a Regular Expression During Script Execution |
|
|
247 | (1) |
|
Executing the Search for a Match in a Specified String |
|
|
247 | (3) |
|
Testing the Search for a Match (Boolean) |
|
|
250 | (4) |
|
Using String Object Methods |
|
|
254 | (7) |
|
|
|
254 | (1) |
|
Testing the Search for a Match (Index) |
|
|
254 | (3) |
|
Replacing Substrings in a String |
|
|
257 | (4) |
|
|
|
261 | (34) |
|
Obtaining Object Signing Tools |
|
|
262 | (8) |
|
|
|
262 | (6) |
|
|
|
268 | (2) |
|
Preparing a Script for Signing |
|
|
270 | (21) |
|
Creating and Identifying the Archive |
|
|
270 | (1) |
|
|
|
271 | (1) |
|
|
|
271 | (1) |
|
|
|
272 | (2) |
|
Examples of Signed Scripts |
|
|
274 | (17) |
|
Running the Page Signing Script |
|
|
291 | (1) |
|
Moving or Editing Signed Script Files |
|
|
292 | (1) |
|
Summary of the Object Signing Process |
|
|
293 | (2) |
|
Chapter 9 New Event Model |
|
|
295 | (20) |
|
Comparison of Old and New Event Models |
|
|
296 | (5) |
|
New Methods for Event Handling |
|
|
298 | (1) |
|
Outline for Event Handling |
|
|
298 | (1) |
|
Processing Captured Events |
|
|
299 | (1) |
|
Releasing Captured Events |
|
|
300 | (1) |
|
|
|
301 | (1) |
|
|
|
302 | (4) |
|
|
|
306 | (1) |
|
|
|
307 | (8) |
|
Chapter 10 Global Objects |
|
|
315 | (22) |
|
|
|
316 | (2) |
|
|
|
316 | (1) |
|
|
|
317 | (1) |
|
watch() and unwatch() Methods |
|
|
317 | (1) |
|
|
|
318 | (4) |
|
Getting the Name of the Browser Language |
|
|
318 | (1) |
|
Getting the Name of the Platform |
|
|
319 | (1) |
|
Example of Using navigator Object Properties |
|
|
319 | (2) |
|
Setting Navigator Preferences from a Signed Script |
|
|
321 | (1) |
|
|
|
322 | (3) |
|
Testing for Maximum and Minimum Values for a Number |
|
|
323 | (1) |
|
|
|
323 | (1) |
|
Testing for Negative and Positive Infinity |
|
|
324 | (1) |
|
Creating Your Own Properties for a Number Object |
|
|
324 | (1) |
|
Converting Numbers to Strings |
|
|
325 | (1) |
|
|
|
325 | (9) |
|
Determining the ISO-Latin-1 Codeset Value of a Character in a String |
|
|
326 | (1) |
|
Getting a String from a Sequence of ISO-Latin-1 Codeset Values |
|
|
326 | (1) |
|
|
|
327 | (1) |
|
Searching, Matching, and Replacing Strings |
|
|
328 | (1) |
|
Extracting Substrings from a String |
|
|
328 | (3) |
|
|
|
331 | (3) |
|
|
|
334 | (3) |
|
Chapter 11 What's New in the Window Object |
|
|
337 | (30) |
|
Showing or Hiding Window User Interface Elements |
|
|
339 | (1) |
|
Controlling Window Dimensions |
|
|
340 | (5) |
|
Example of Modifying Window Properties |
|
|
341 | (4) |
|
Determining the Current Position of a Viewed Page |
|
|
345 | (1) |
|
Example of Determining the Current Position of a Viewed Page |
|
|
345 | (1) |
|
Accessing Toolbar Buttons Programmatically |
|
|
346 | (4) |
|
Example of Accessing Toolbar Buttons Programmatically |
|
|
347 | (3) |
|
Finding a Text String within a Window |
|
|
350 | (1) |
|
Example of Finding a Text String within a Window |
|
|
350 | (1) |
|
Opening a New Web Browser Window |
|
|
351 | (4) |
|
Moving and Resizing Windows |
|
|
355 | (4) |
|
Example of Moving and Resizing a Window |
|
|
356 | (3) |
|
Calling Functions from the setTimeout() Method |
|
|
359 | (1) |
|
Setting and Clearing Intervals |
|
|
360 | (3) |
|
Example of setTimeout() Method and Setting and Clearing Intervals |
|
|
360 | (3) |
|
Capturing Events from Other Windows |
|
|
363 | (1) |
|
Intercepting a DragDrop Event |
|
|
363 | (1) |
|
Intercepting a Move Event |
|
|
364 | (1) |
|
Intercepting a Resize Event |
|
|
365 | (2) |
|
Chapter 12 What's New in Documents |
|
|
367 | (32) |
|
|
|
368 | (1) |
|
Example of Using the text Property |
|
|
368 | (1) |
|
|
|
369 | (13) |
|
Creating an Array by Using Literal Notation |
|
|
369 | (1) |
|
|
|
369 | (13) |
|
|
|
382 | (2) |
|
Example of Using button Object Event Handlers |
|
|
383 | (1) |
|
|
|
384 | (7) |
|
Getting Style Classes, ID, and Tags Attributes |
|
|
385 | (1) |
|
|
|
386 | (1) |
|
Getting the Current Selection |
|
|
386 | (2) |
|
Controlling Events When Users Press or Release a Mouse Button |
|
|
388 | (2) |
|
Controlling Events When Users Double-click a Mouse Button |
|
|
390 | (1) |
|
Controlling Events When Users Press or Release a Key |
|
|
390 | (1) |
|
|
|
391 | (1) |
|
|
|
392 | (5) |
|
Example of Using the text Property |
|
|
393 | (1) |
|
Controlling Events When Users Press or Release a Mouse Button |
|
|
393 | (1) |
|
Controlling Events When Users Double-click a Mouse Button |
|
|
394 | (1) |
|
Controlling Events When Users Press or Release a Key |
|
|
395 | (1) |
|
Controlling Events When Users Press or Release a Mouse Button |
|
|
396 | (1) |
|
|
|
397 | (2) |
|
Appendix A What's New in JavaScript 1.3 |
|
|
399 | (46) |
|
|
|
399 | (1) |
|
|
|
400 | (1) |
|
|
|
400 | (2) |
|
Non-ECMA-262 Features of JavaScript 1.2 and 1.3 |
|
|
401 | (1) |
|
|
|
402 | (2) |
|
|
|
404 | (3) |
|
|
|
405 | (1) |
|
|
|
405 | (1) |
|
|
|
406 | (1) |
|
isFinite() Global Function |
|
|
407 | (2) |
|
Example Using the isFinite() Global Function |
|
|
407 | (2) |
|
|
|
409 | (3) |
|
Example of Using the toSource() Method |
|
|
410 | (2) |
|
|
|
412 | (16) |
|
|
|
414 | (1) |
|
Getting the UTC in Milliseconds |
|
|
415 | (1) |
|
Getting and Setting the Year |
|
|
416 | (2) |
|
Getting and Setting Milliseconds |
|
|
418 | (1) |
|
Getting and Setting the Month, Date, and Day as a UTC Value |
|
|
419 | (1) |
|
Getting and Setting the Time as a UTC Value |
|
|
420 | (4) |
|
Obtaining a UTC Date String |
|
|
424 | (1) |
|
Changes to the Date Methods |
|
|
425 | (1) |
|
|
|
425 | (3) |
|
New Methods of Function Object |
|
|
428 | (1) |
|
|
|
428 | (1) |
|
|
|
429 | (1) |
|
Strict Comparison Operators |
|
|
429 | (4) |
|
Example of Comparison Operators |
|
|
430 | (3) |
|
|
|
433 | (3) |
|
Setting the JavaScript Console Preferences |
|
|
435 | (1) |
|
Changes in JavaScript 1.3 |
|
|
436 | (9) |
|
|
|
436 | (1) |
|
Changes to the Array Object |
|
|
437 | (3) |
|
replace() Method of String Object |
|
|
440 | (3) |
|
|
|
443 | (1) |
|
|
|
443 | (2) |
|
Appendix B JavaScript Quick Reference |
|
|
445 | (50) |
|
|
|
445 | (38) |
|
|
|
446 | (1) |
|
|
|
446 | (1) |
|
|
|
447 | (1) |
|
|
|
448 | (1) |
|
|
|
449 | (1) |
|
|
|
449 | (1) |
|
|
|
450 | (1) |
|
|
|
451 | (1) |
|
|
|
452 | (2) |
|
|
|
454 | (1) |
|
|
|
455 | (1) |
|
|
|
456 | (1) |
|
|
|
457 | (1) |
|
|
|
458 | (1) |
|
|
|
459 | (1) |
|
|
|
460 | (1) |
|
|
|
460 | (1) |
|
|
|
461 | (2) |
|
|
|
463 | (2) |
|
|
|
465 | (1) |
|
|
|
466 | (1) |
|
|
|
467 | (1) |
|
|
|
467 | (1) |
|
|
|
468 | (1) |
|
|
|
469 | (1) |
|
|
|
470 | (1) |
|
|
|
470 | (1) |
|
|
|
471 | (2) |
|
|
|
473 | (1) |
|
|
|
473 | (1) |
|
|
|
474 | (2) |
|
|
|
476 | (1) |
|
|
|
477 | (1) |
|
|
|
477 | (1) |
|
|
|
478 | (1) |
|
|
|
479 | (4) |
|
|
|
483 | (1) |
|
|
|
484 | (5) |
|
Reserved JavaScript Keywords |
|
|
489 | (1) |
|
Escape Characters for String Formatting |
|
|
489 | (1) |
|
|
|
490 | (5) |
| Glossary |
|
495 | (4) |
| Index |
|
499 | |