| Foreword |
|
xlvii | |
| Introduction |
|
xlix | |
| Chapter 1 What Is Javascript? |
|
1 | (12) |
|
|
|
2 | (1) |
|
JavaScript Implementations |
|
|
3 | (8) |
|
|
|
3 | (4) |
|
|
|
4 | (1) |
|
What Does ECMAScript Conformance Mean? |
|
|
5 | (1) |
|
ECMAScript Support in Web Browsers |
|
|
5 | (2) |
|
The Document Object Model |
|
|
7 | (3) |
|
|
|
8 | (1) |
|
|
|
8 | (1) |
|
|
|
9 | (1) |
|
DOM Support in Web Browsers |
|
|
9 | (1) |
|
|
|
10 | (1) |
|
|
|
11 | (1) |
|
|
|
12 | (1) |
| Chapter 2 Javascript In HTML |
|
13 | (12) |
|
|
|
13 | (8) |
|
|
|
16 | (1) |
|
|
|
17 | (1) |
|
|
|
17 | (1) |
|
|
|
18 | (1) |
|
|
|
19 | (1) |
|
|
|
20 | (1) |
|
Inline Code versus External Files |
|
|
21 | (1) |
|
|
|
22 | (1) |
|
|
|
23 | (1) |
|
|
|
24 | (1) |
| Chapter 3 Language Basics |
|
25 | (76) |
|
|
|
25 | (3) |
|
|
|
26 | (1) |
|
|
|
26 | (1) |
|
|
|
26 | (1) |
|
|
|
27 | (1) |
|
|
|
27 | (1) |
|
Keywords and Reserved Words |
|
|
28 | (1) |
|
|
|
29 | (7) |
|
|
|
29 | (2) |
|
|
|
29 | (1) |
|
|
|
30 | (1) |
|
|
|
31 | (3) |
|
|
|
32 | (1) |
|
|
|
32 | (1) |
|
|
|
32 | (2) |
|
let Declaration in for Loops |
|
|
34 | (1) |
|
|
|
34 | (1) |
|
Declaration Styles and Best Practices |
|
|
35 | (1) |
|
|
|
36 | (1) |
|
|
|
36 | (1) |
|
|
|
36 | (32) |
|
|
|
36 | (1) |
|
|
|
37 | (2) |
|
|
|
39 | (1) |
|
|
|
40 | (1) |
|
|
|
41 | (5) |
|
|
|
41 | (1) |
|
|
|
42 | (1) |
|
|
|
43 | (1) |
|
|
|
44 | (2) |
|
|
|
46 | (8) |
|
|
|
47 | (1) |
|
|
|
48 | (1) |
|
|
|
48 | (1) |
|
|
|
49 | (1) |
|
|
|
50 | (1) |
|
Template Literal Tag Functions |
|
|
51 | (2) |
|
|
|
53 | (1) |
|
|
|
54 | (13) |
|
|
|
54 | (1) |
|
Using the Global Symbol Registry |
|
|
55 | (1) |
|
Using Symbols as Properties |
|
|
56 | (1) |
|
|
|
57 | (10) |
|
|
|
67 | (1) |
|
|
|
68 | (22) |
|
|
|
68 | (4) |
|
|
|
68 | (2) |
|
|
|
70 | (2) |
|
|
|
72 | (5) |
|
|
|
73 | (1) |
|
|
|
74 | (1) |
|
|
|
74 | (1) |
|
|
|
75 | (1) |
|
|
|
76 | (1) |
|
|
|
76 | (1) |
|
|
|
76 | (1) |
|
|
|
77 | (3) |
|
|
|
77 | (1) |
|
|
|
78 | (1) |
|
|
|
79 | (1) |
|
|
|
80 | (2) |
|
|
|
80 | (1) |
|
|
|
81 | (1) |
|
|
|
82 | (1) |
|
|
|
82 | (1) |
|
|
|
82 | (3) |
|
|
|
83 | (1) |
|
|
|
84 | (1) |
|
|
|
85 | (1) |
|
|
|
86 | (2) |
|
|
|
86 | (1) |
|
Identically Equal and Not Identically Equal |
|
|
87 | (1) |
|
|
|
88 | (1) |
|
|
|
88 | (1) |
|
|
|
89 | (1) |
|
|
|
90 | (8) |
|
|
|
90 | (1) |
|
|
|
90 | (1) |
|
|
|
91 | (1) |
|
|
|
91 | (1) |
|
|
|
92 | (1) |
|
|
|
93 | (1) |
|
|
|
93 | (1) |
|
The break and continue Statements |
|
|
94 | (1) |
|
|
|
95 | (1) |
|
|
|
96 | (2) |
|
|
|
98 | (2) |
|
|
|
100 | (1) |
| Chapter 4 Variables, Scope, And Memory |
|
101 | (24) |
|
Primitive and Reference Values |
|
|
101 | (5) |
|
|
|
102 | (1) |
|
|
|
103 | (1) |
|
|
|
103 | (2) |
|
|
|
105 | (1) |
|
Execution Context and Scope |
|
|
106 | (8) |
|
|
|
108 | (1) |
|
|
|
109 | (5) |
|
Function Scope Declaration Using var |
|
|
109 | (2) |
|
Block Scope Declaration Using let |
|
|
111 | (1) |
|
Constant Declaration Using const |
|
|
112 | (1) |
|
|
|
113 | (1) |
|
|
|
114 | (8) |
|
|
|
115 | (1) |
|
|
|
115 | (1) |
|
|
|
116 | (1) |
|
|
|
117 | (9) |
|
Performance Boosts with const and let Declarations |
|
|
118 | (1) |
|
Hidden Classes and the delete Operation |
|
|
118 | (1) |
|
|
|
119 | (1) |
|
Static Allocation and Object Pools |
|
|
120 | (2) |
|
|
|
122 | (3) |
| Chapter 5 Basic Reference Types |
|
125 | (42) |
|
|
|
126 | (5) |
|
|
|
128 | (1) |
|
|
|
129 | (1) |
|
Date/Time Component Methods |
|
|
129 | (2) |
|
|
|
131 | (8) |
|
RegExp Instance Properties |
|
|
134 | (1) |
|
|
|
135 | (2) |
|
RegExp Constructor Properties |
|
|
137 | (2) |
|
|
|
139 | (1) |
|
|
|
139 | (18) |
|
|
|
141 | (1) |
|
|
|
141 | (3) |
|
The isInteger() Method and Safe Integers |
|
|
143 | (1) |
|
|
|
144 | (13) |
|
|
|
144 | (3) |
|
|
|
147 | (1) |
|
String-Manipulation Methods |
|
|
148 | (2) |
|
|
|
150 | (1) |
|
|
|
151 | (1) |
|
|
|
151 | (1) |
|
|
|
152 | (1) |
|
The padStart() and padEnd() Methods |
|
|
152 | (1) |
|
String Iterators and Destructuring |
|
|
152 | (1) |
|
|
|
153 | (1) |
|
String Pattern-Matching Methods |
|
|
153 | (3) |
|
The localeCompare() Method |
|
|
156 | (1) |
|
|
|
157 | (1) |
|
Singleton Built-in Objects |
|
|
157 | (8) |
|
|
|
157 | (4) |
|
|
|
158 | (1) |
|
|
|
159 | (1) |
|
|
|
160 | (1) |
|
|
|
161 | (1) |
|
|
|
161 | (9) |
|
|
|
162 | (1) |
|
The min() and max() Methods |
|
|
162 | (1) |
|
|
|
163 | (1) |
|
|
|
163 | (1) |
|
|
|
164 | (1) |
|
|
|
165 | (2) |
| Chapter 6 Collection Reference Types |
|
167 | (58) |
|
|
|
167 | (3) |
|
|
|
170 | (20) |
|
|
|
170 | (2) |
|
|
|
172 | (2) |
|
|
|
174 | (1) |
|
|
|
175 | (1) |
|
|
|
176 | (1) |
|
|
|
176 | (3) |
|
|
|
179 | (1) |
|
|
|
180 | (1) |
|
|
|
181 | (1) |
|
|
|
182 | (2) |
|
|
|
184 | (2) |
|
Search and Location Methods |
|
|
186 | (2) |
|
|
|
186 | (1) |
|
|
|
187 | (1) |
|
|
|
188 | (1) |
|
|
|
189 | (1) |
|
|
|
190 | (11) |
|
|
|
190 | (1) |
|
|
|
190 | (1) |
|
Emergence of Typed Arrays |
|
|
191 | (1) |
|
|
|
191 | (1) |
|
|
|
192 | (4) |
|
|
|
193 | (1) |
|
Big-Endian and Little-Endian |
|
|
194 | (1) |
|
|
|
195 | (1) |
|
|
|
196 | (5) |
|
|
|
197 | (1) |
|
Merging, Copying, and Changing Typed Arrays |
|
|
198 | (2) |
|
|
|
200 | (1) |
|
|
|
201 | (5) |
|
|
|
201 | (2) |
|
|
|
203 | (3) |
|
Choosing Between Objects and Maps |
|
|
206 | (1) |
|
|
|
206 | (1) |
|
|
|
206 | (1) |
|
|
|
206 | (1) |
|
|
|
206 | (1) |
|
|
|
206 | (5) |
|
|
|
207 | (1) |
|
|
|
208 | (1) |
|
|
|
209 | (1) |
|
|
|
209 | (2) |
|
|
|
209 | (2) |
|
|
|
211 | (1) |
|
|
|
211 | (6) |
|
|
|
211 | (2) |
|
|
|
213 | (2) |
|
Defining Formal Set Operations |
|
|
215 | (2) |
|
|
|
217 | (3) |
|
|
|
217 | (2) |
|
|
|
219 | (1) |
|
|
|
219 | (1) |
|
|
|
219 | (1) |
|
Iteration and Spread Operators |
|
|
220 | (2) |
|
|
|
222 | (3) |
| Chapter 7 Iterators And Generators |
|
225 | (26) |
|
Introduction to Iteration |
|
|
225 | (1) |
|
|
|
226 | (10) |
|
|
|
227 | (2) |
|
|
|
229 | (2) |
|
Custom Iterator Definition |
|
|
231 | (2) |
|
Early Termination of Iterators |
|
|
233 | (3) |
|
|
|
236 | (13) |
|
|
|
236 | (2) |
|
Interrupting Execution with "yield" |
|
|
238 | (8) |
|
Using a Generator Object as an Iterable |
|
|
239 | (1) |
|
Using "yield" for Input and Output |
|
|
240 | (2) |
|
|
|
242 | (2) |
|
Recursive Algorithms Using yield |
|
|
244 | (2) |
|
Using a Generator as the Default Iterator |
|
|
246 | (1) |
|
Early Termination of Generators |
|
|
247 | (4) |
|
|
|
247 | (1) |
|
|
|
248 | (1) |
|
|
|
249 | (2) |
| Chapter 8 Objects, Classes, And Object-Oriented Programming |
|
251 | (72) |
|
|
|
251 | (17) |
|
|
|
252 | (3) |
|
|
|
252 | (2) |
|
|
|
254 | (1) |
|
Defining Multiple Properties |
|
|
255 | (1) |
|
Reading Property Attributes |
|
|
256 | (1) |
|
|
|
257 | (3) |
|
Object Identity and Equality |
|
|
260 | (1) |
|
|
|
261 | (3) |
|
|
|
261 | (1) |
|
|
|
262 | (1) |
|
|
|
263 | (1) |
|
|
|
264 | (4) |
|
|
|
266 | (1) |
|
Partial Destructuring Completion |
|
|
267 | (1) |
|
Parameter Context Matching |
|
|
268 | (1) |
|
|
|
268 | (21) |
|
|
|
268 | (1) |
|
|
|
269 | (1) |
|
The Function Constructor Pattern |
|
|
269 | (4) |
|
Constructors as Functions |
|
|
272 | (1) |
|
Problems with Constructors |
|
|
272 | (1) |
|
|
|
273 | (11) |
|
|
|
274 | (4) |
|
Understanding the Prototype Hierarchy |
|
|
278 | (3) |
|
Prototypes and the "in" Operator |
|
|
281 | (2) |
|
Property Enumeration Order |
|
|
283 | (1) |
|
|
|
284 | (5) |
|
Alternate Prototype Syntax |
|
|
285 | (1) |
|
Dynamic Nature of Prototypes |
|
|
286 | (1) |
|
|
|
287 | (1) |
|
|
|
288 | (1) |
|
|
|
289 | (13) |
|
|
|
289 | (5) |
|
|
|
291 | (1) |
|
Prototype and Instance Relationships |
|
|
291 | (1) |
|
|
|
292 | (2) |
|
Problems with Prototype Chaining |
|
|
294 | (1) |
|
|
|
294 | (2) |
|
|
|
295 | (1) |
|
Problems with Constructor Stealing |
|
|
296 | (1) |
|
|
|
296 | (1) |
|
|
|
297 | (1) |
|
|
|
298 | (1) |
|
Parasitic Combination Inheritance |
|
|
299 | (3) |
|
|
|
302 | (18) |
|
|
|
302 | (1) |
|
|
|
303 | (1) |
|
|
|
303 | (4) |
|
|
|
304 | (2) |
|
Understanding Classes as Special Functions |
|
|
306 | (1) |
|
Instance, Prototype, and Class Members |
|
|
307 | (5) |
|
|
|
307 | (1) |
|
Prototype Methods and Accessors |
|
|
308 | (1) |
|
Static Class Methods and Accessors |
|
|
309 | (1) |
|
Non-Function Prototype and Class Members |
|
|
310 | (1) |
|
Iterator and Generator Methods |
|
|
311 | (1) |
|
|
|
312 | (12) |
|
|
|
312 | (1) |
|
Constructors, HomeObjects, and super() |
|
|
313 | (3) |
|
|
|
316 | (1) |
|
Inheriting from Built-in Types |
|
|
317 | (1) |
|
|
|
318 | (2) |
|
|
|
320 | (3) |
| Chapter 9 Proxies And Reflect |
|
323 | (26) |
|
|
|
324 | (9) |
|
Creating a Passthrough Proxy |
|
|
324 | (1) |
|
|
|
325 | (1) |
|
Trap Parameters and the Reflect API |
|
|
326 | (2) |
|
|
|
328 | (1) |
|
|
|
329 | (1) |
|
Utility of the Reflect API |
|
|
329 | (2) |
|
Reflect API vs. Object API |
|
|
330 | (1) |
|
|
|
330 | (1) |
|
Supplanting Operators with First-Class Functions |
|
|
331 | (1) |
|
Safe Function Application |
|
|
331 | (1) |
|
|
|
331 | (1) |
|
Proxy Considerations and Shortcomings |
|
|
332 | (1) |
|
|
|
332 | (1) |
|
Proxies and Internal Slots |
|
|
333 | (1) |
|
Proxy Traps and Reflect Methods |
|
|
333 | (11) |
|
|
|
333 | (1) |
|
|
|
334 | (1) |
|
|
|
334 | (1) |
|
|
|
334 | (1) |
|
|
|
334 | (1) |
|
|
|
334 | (1) |
|
|
|
335 | (1) |
|
|
|
335 | (1) |
|
|
|
335 | (1) |
|
|
|
335 | (1) |
|
|
|
335 | (1) |
|
|
|
336 | (1) |
|
|
|
336 | (1) |
|
|
|
336 | (1) |
|
|
|
336 | (1) |
|
|
|
336 | (1) |
|
|
|
336 | (1) |
|
|
|
336 | (1) |
|
|
|
337 | (1) |
|
|
|
337 | (1) |
|
getOwnPropertyDescriptor() |
|
|
337 | (1) |
|
|
|
337 | (1) |
|
|
|
337 | (1) |
|
|
|
337 | (1) |
|
|
|
338 | (1) |
|
|
|
338 | (1) |
|
|
|
338 | (1) |
|
|
|
338 | (1) |
|
|
|
338 | (1) |
|
|
|
339 | (1) |
|
|
|
339 | (1) |
|
|
|
339 | (1) |
|
|
|
339 | (1) |
|
|
|
339 | (1) |
|
|
|
339 | (1) |
|
|
|
339 | (1) |
|
|
|
340 | (1) |
|
|
|
340 | (1) |
|
|
|
340 | (1) |
|
|
|
340 | (1) |
|
|
|
340 | (1) |
|
|
|
341 | (1) |
|
|
|
341 | (1) |
|
|
|
341 | (1) |
|
|
|
341 | (1) |
|
|
|
341 | (1) |
|
|
|
341 | (1) |
|
|
|
341 | (1) |
|
|
|
342 | (1) |
|
|
|
342 | (1) |
|
|
|
342 | (1) |
|
|
|
342 | (1) |
|
|
|
342 | (1) |
|
|
|
342 | (1) |
|
|
|
342 | (1) |
|
|
|
342 | (1) |
|
|
|
343 | (1) |
|
|
|
343 | (1) |
|
|
|
343 | (1) |
|
|
|
343 | (1) |
|
|
|
343 | (1) |
|
|
|
343 | (1) |
|
|
|
344 | (1) |
|
|
|
344 | (1) |
|
|
|
344 | (1) |
|
|
|
344 | (4) |
|
|
|
344 | (1) |
|
|
|
345 | (1) |
|
|
|
345 | (1) |
|
Function and Constructor Parameter Validation |
|
|
346 | (1) |
|
Data Binding and Observables |
|
|
347 | (1) |
|
|
|
348 | (1) |
| Chapter 10 Functions |
|
349 | (42) |
|
|
|
350 | (1) |
|
|
|
351 | (2) |
|
|
|
353 | (2) |
|
Arguments in Arrow Functions |
|
|
355 | (1) |
|
|
|
355 | (1) |
|
|
|
356 | (3) |
|
Default Parameter Scope and Temporal Dead Zone |
|
|
358 | (1) |
|
Spread Arguments and Rest Parameters |
|
|
359 | (2) |
|
|
|
359 | (1) |
|
|
|
360 | (1) |
|
Function Declarations versus Function Expressions |
|
|
361 | (1) |
|
|
|
362 | (2) |
|
|
|
364 | (3) |
|
|
|
364 | (1) |
|
|
|
365 | (1) |
|
|
|
366 | (1) |
|
|
|
367 | (1) |
|
Function Properties and Methods |
|
|
367 | (3) |
|
|
|
370 | (2) |
|
|
|
372 | (1) |
|
|
|
373 | (16) |
|
Tail Call Optimization Requirements |
|
|
374 | (1) |
|
Coding for Tail Call Optimization |
|
|
375 | (1) |
|
|
|
376 | (6) |
|
|
|
379 | (2) |
|
|
|
381 | (1) |
|
Immediately Invoked Function Expressions |
|
|
382 | (2) |
|
|
|
384 | (8) |
|
|
|
385 | (2) |
|
|
|
387 | (1) |
|
The Module-Augmentation Pattern |
|
|
388 | (1) |
|
|
|
389 | (2) |
| Chapter 11 Promises And ASYNC Functions |
|
391 | (46) |
|
Introduction to Asynchronous Programming |
|
|
392 | (3) |
|
Synchronous vs. Asynchronous JavaScript |
|
|
392 | (1) |
|
Legacy Asynchronous Programming Patterns |
|
|
393 | (2) |
|
Returning Asynchronous Values |
|
|
393 | (1) |
|
|
|
394 | (1) |
|
Nesting Asynchronous Callbacks |
|
|
394 | (1) |
|
|
|
395 | (26) |
|
The Promises/A+ Specification |
|
|
395 | (1) |
|
|
|
395 | (5) |
|
The Promise State Machine |
|
|
396 | (1) |
|
Resolved Values, Rejection Reasons, and Utility of Promises |
|
|
396 | (1) |
|
Controlling Promise State with the Executor |
|
|
397 | (1) |
|
Promise Casting with Promise.resolve() |
|
|
398 | (1) |
|
Promise Rejection with Promise.reject() |
|
|
399 | (1) |
|
Synchronous/Asynchronous Execution Duality |
|
|
399 | (1) |
|
|
|
400 | (10) |
|
Implementing the Thenable Interface |
|
|
400 | (1) |
|
|
|
400 | (3) |
|
Promise.prototype.catch() |
|
|
403 | (1) |
|
Promise.prototype.finally() |
|
|
404 | (1) |
|
Non-Reentrant Promise Methods |
|
|
405 | (2) |
|
Sibling Handler Order of Execution |
|
|
407 | (1) |
|
Resolved Value and Rejected Reason Passing |
|
|
408 | (1) |
|
Rejecting Promises and Rejection Error Handling |
|
|
408 | (2) |
|
Promise Chaining and Composition |
|
|
410 | (8) |
|
|
|
410 | (3) |
|
|
|
413 | (1) |
|
Parallel Promise Composition with Promise.all() and Promise.race() |
|
|
414 | (2) |
|
Serial Promise Composition |
|
|
416 | (2) |
|
|
|
418 | (3) |
|
|
|
418 | (1) |
|
Promise Progress Notifications |
|
|
419 | (2) |
|
|
|
421 | (14) |
|
|
|
422 | (5) |
|
|
|
422 | (2) |
|
|
|
424 | (2) |
|
|
|
426 | (1) |
|
Halting and Resuming Execution |
|
|
427 | (3) |
|
Strategies for Async Functions |
|
|
430 | (8) |
|
|
|
430 | (1) |
|
Maximizing Parallelization |
|
|
431 | (3) |
|
|
|
434 | (1) |
|
Stack Traces and Memory Management |
|
|
434 | (1) |
|
|
|
435 | (2) |
| Chapter 12 The Browser Object Model |
|
437 | (28) |
|
|
|
438 | (12) |
|
|
|
438 | (1) |
|
|
|
439 | (1) |
|
Window Position and Pixel Ratio |
|
|
439 | (1) |
|
|
|
439 | (1) |
|
|
|
440 | (1) |
|
|
|
441 | (1) |
|
Navigating and Opening Windows |
|
|
442 | (4) |
|
|
|
442 | (3) |
|
|
|
445 | (1) |
|
|
|
445 | (1) |
|
|
|
446 | (2) |
|
|
|
448 | (2) |
|
|
|
450 | (4) |
|
|
|
451 | (1) |
|
|
|
452 | (1) |
|
Manipulating the Location |
|
|
452 | (2) |
|
|
|
454 | (5) |
|
|
|
456 | (3) |
|
Legacy Internet Explorer Plugin Detection |
|
|
457 | (2) |
|
|
|
459 | (1) |
|
|
|
459 | (1) |
|
|
|
460 | (2) |
|
|
|
460 | (1) |
|
|
|
461 | (1) |
|
|
|
462 | (3) |
| Chapter 13 Client Detection |
|
465 | (26) |
|
|
|
466 | (4) |
|
Safer Capability Detection |
|
|
467 | (1) |
|
Using Capability Detection for Browser Analysis |
|
|
468 | (2) |
|
Detecting Feature Support |
|
|
468 | (1) |
|
Detecting Browser Identity |
|
|
468 | (1) |
|
Capability Detection Limitations |
|
|
469 | (1) |
|
|
|
470 | (10) |
|
History of User-Agent Composition |
|
|
470 | (8) |
|
|
|
470 | (1) |
|
Netscape Navigator 3 and Internet Explorer 3 |
|
|
471 | (1) |
|
Netscape Communicator 4 and Internet Explorer 4 Through 8 |
|
|
472 | (1) |
|
|
|
473 | (2) |
|
|
|
475 | (1) |
|
|
|
476 | (1) |
|
|
|
476 | (1) |
|
|
|
476 | (2) |
|
|
|
478 | (1) |
|
Using User-Agent for Browser Analysis |
|
|
478 | (2) |
|
|
|
479 | (1) |
|
Using User-Agents for Browser Analysis |
|
|
479 | (1) |
|
Software and Hardware Detection |
|
|
480 | (9) |
|
Browser and Operating System Identification |
|
|
481 | (1) |
|
The navigator.oscpu Property |
|
|
481 | (1) |
|
The navigator.vendor Property |
|
|
481 | (1) |
|
The navigator.platform Property |
|
|
481 | (1) |
|
The screen.colorDepth and screen.pixelDepth Properties |
|
|
482 | (1) |
|
The screen.orientation Property |
|
|
482 | (1) |
|
|
|
482 | (7) |
|
|
|
483 | (3) |
|
Connection State and the NetworkInformation API |
|
|
486 | (1) |
|
|
|
487 | (2) |
|
|
|
489 | (3) |
|
|
|
489 | (1) |
|
|
|
489 | (1) |
|
|
|
489 | (1) |
|
|
|
489 | (2) |
| Chapter 14 The Document Object Model |
|
491 | (52) |
|
|
|
492 | (29) |
|
|
|
492 | (6) |
|
The nodeName and nodeValue Properties |
|
|
493 | (1) |
|
|
|
494 | (1) |
|
|
|
495 | (2) |
|
|
|
497 | (1) |
|
|
|
498 | (8) |
|
|
|
498 | (1) |
|
|
|
499 | (1) |
|
|
|
500 | (2) |
|
|
|
502 | (1) |
|
DOM Conformance Detection |
|
|
503 | (1) |
|
|
|
504 | (2) |
|
|
|
506 | (8) |
|
|
|
507 | (3) |
|
|
|
510 | (1) |
|
|
|
511 | (1) |
|
|
|
511 | (2) |
|
|
|
513 | (1) |
|
|
|
513 | (1) |
|
|
|
514 | (3) |
|
|
|
515 | (1) |
|
|
|
516 | (1) |
|
|
|
517 | (1) |
|
|
|
517 | (1) |
|
|
|
518 | (1) |
|
|
|
518 | (1) |
|
The DocumentFragment Type |
|
|
519 | (1) |
|
|
|
520 | (1) |
|
|
|
521 | (8) |
|
|
|
521 | (2) |
|
|
|
523 | (2) |
|
|
|
525 | (3) |
|
|
|
528 | (1) |
|
|
|
529 | (13) |
|
|
|
529 | (5) |
|
|
|
529 | (1) |
|
Working with Callbacks and MutationRecords |
|
|
530 | (2) |
|
|
|
532 | (1) |
|
Multiplexing a MutationObserver |
|
|
532 | (1) |
|
Reusing a MutationObserver |
|
|
533 | (1) |
|
Controlling the Observer scope with MutationObserverinit |
|
|
534 | (6) |
|
Observing attribute mutations |
|
|
535 | (1) |
|
Observing character data mutations |
|
|
536 | (1) |
|
Observing child mutations |
|
|
537 | (2) |
|
Observing subtree mutations |
|
|
539 | (1) |
|
Async Callbacks and the Record Queue |
|
|
540 | (1) |
|
Behavior of the Record Queue |
|
|
540 | (1) |
|
|
|
541 | (1) |
|
Performance, Memory, and Garbage Collection |
|
|
541 | (3) |
|
MutationObserver References |
|
|
541 | (1) |
|
MutationRecord References |
|
|
542 | (1) |
|
|
|
542 | (1) |
| Chapter 15 DOM Extensions |
|
543 | (20) |
|
|
|
544 | (2) |
|
The querySelector() Method |
|
|
544 | (1) |
|
The querySelectorAll() Method |
|
|
544 | (1) |
|
|
|
545 | (1) |
|
|
|
546 | (1) |
|
|
|
547 | (10) |
|
|
|
547 | (2) |
|
The getElementsByClassName() Method |
|
|
547 | (1) |
|
|
|
548 | (1) |
|
|
|
549 | (1) |
|
|
|
550 | (1) |
|
|
|
550 | (1) |
|
|
|
550 | (1) |
|
|
|
551 | (1) |
|
|
|
551 | (1) |
|
|
|
551 | (1) |
|
|
|
552 | (4) |
|
|
|
552 | (1) |
|
Using innerHTML in Legacy Internet Explorer |
|
|
553 | (1) |
|
|
|
554 | (1) |
|
The insertAdjacentHTML() and insertAdjacentText() Methods |
|
|
555 | (1) |
|
Memory and Performance Issues |
|
|
555 | (1) |
|
Cross-Site Scripting Considerations |
|
|
556 | (1) |
|
The scrolllntoView() Method |
|
|
556 | (1) |
|
|
|
557 | (3) |
|
|
|
557 | (1) |
|
|
|
557 | (1) |
|
|
|
558 | (2) |
|
|
|
558 | (2) |
|
|
|
560 | (1) |
|
|
|
560 | (1) |
|
|
|
560 | (3) |
| Chapter 16 DOM Levels 2 And 3 |
|
563 | (38) |
|
|
|
564 | (8) |
|
|
|
564 | (4) |
|
|
|
566 | (1) |
|
|
|
567 | (1) |
|
|
|
567 | (1) |
|
|
|
568 | (1) |
|
|
|
568 | (4) |
|
|
|
568 | (1) |
|
|
|
569 | (1) |
|
|
|
570 | (1) |
|
|
|
571 | (1) |
|
|
|
572 | (12) |
|
|
|
572 | (4) |
|
DOM Style Properties and Methods |
|
|
573 | (2) |
|
|
|
575 | (1) |
|
Working with Style Sheets |
|
|
576 | (3) |
|
|
|
577 | (1) |
|
|
|
578 | (1) |
|
|
|
579 | (1) |
|
|
|
579 | (5) |
|
|
|
579 | (2) |
|
|
|
581 | (1) |
|
|
|
582 | (2) |
|
Determining Element Dimensions |
|
|
584 | (1) |
|
|
|
584 | (6) |
|
|
|
585 | (3) |
|
|
|
588 | (2) |
|
|
|
590 | (9) |
|
|
|
590 | (1) |
|
Simple Selection in DOM Ranges |
|
|
591 | (1) |
|
Complex Selection in DOM Ranges |
|
|
592 | (1) |
|
Interacting with DOM Range Content |
|
|
593 | (3) |
|
Inserting DOM Range Content |
|
|
596 | (1) |
|
|
|
597 | (1) |
|
|
|
597 | (1) |
|
|
|
598 | (1) |
|
|
|
598 | (1) |
|
|
|
599 | (2) |
| Chapter 17 Events |
|
601 | (70) |
|
|
|
602 | (2) |
|
|
|
602 | (1) |
|
|
|
603 | (1) |
|
|
|
603 | (1) |
|
|
|
604 | (7) |
|
|
|
604 | (2) |
|
DOM Level 0 Event Handlers |
|
|
606 | (1) |
|
DOM Level 2 Event Handlers |
|
|
607 | (1) |
|
Internet Explorer Event Handlers |
|
|
608 | (2) |
|
Cross-Browser Event Handlers |
|
|
610 | (1) |
|
|
|
611 | (8) |
|
|
|
611 | (4) |
|
The Internet Explorer Event Object |
|
|
615 | (2) |
|
The Cross-Browser Event Object |
|
|
617 | (2) |
|
|
|
619 | (40) |
|
|
|
619 | (5) |
|
|
|
620 | (2) |
|
|
|
622 | (1) |
|
|
|
623 | (1) |
|
|
|
624 | (1) |
|
|
|
624 | (1) |
|
|
|
625 | (9) |
|
|
|
627 | (1) |
|
|
|
628 | (1) |
|
|
|
628 | (1) |
|
|
|
629 | (1) |
|
|
|
630 | (1) |
|
|
|
631 | (1) |
|
Additional Event Information |
|
|
632 | (1) |
|
|
|
633 | (1) |
|
|
|
633 | (1) |
|
|
|
634 | (1) |
|
|
|
634 | (6) |
|
|
|
635 | (1) |
|
|
|
636 | (1) |
|
|
|
637 | (1) |
|
|
|
638 | (1) |
|
Keyboard Events on Devices |
|
|
639 | (1) |
|
|
|
640 | (1) |
|
|
|
641 | (1) |
|
|
|
641 | (6) |
|
|
|
641 | (2) |
|
|
|
643 | (1) |
|
The DOMContentLoaded Event |
|
|
643 | (1) |
|
The readystatechange Event |
|
|
644 | (1) |
|
The pageshow and pagehide Events |
|
|
645 | (2) |
|
|
|
647 | (1) |
|
|
|
647 | (4) |
|
The orientationchange Event |
|
|
647 | (1) |
|
The deviceorientation Event |
|
|
648 | (2) |
|
|
|
650 | (1) |
|
|
|
651 | (3) |
|
|
|
651 | (2) |
|
|
|
653 | (1) |
|
|
|
654 | (5) |
|
|
|
659 | (3) |
|
|
|
659 | (2) |
|
|
|
661 | (1) |
|
|
|
662 | (7) |
|
|
|
663 | (5) |
|
|
|
663 | (1) |
|
Simulating Keyboard Events |
|
|
664 | (3) |
|
|
|
667 | (1) |
|
|
|
667 | (1) |
|
Internet Explorer Event Simulation |
|
|
668 | (1) |
|
|
|
669 | (2) |
| Chapter 18 Animation And Graphics With Canvas |
|
671 | (36) |
|
Using requestAnimationFrame |
|
|
672 | (4) |
|
|
|
672 | (1) |
|
|
|
673 | (1) |
|
|
|
673 | (1) |
|
|
|
674 | (1) |
|
Performance Throttling with requestAnimationFrame |
|
|
674 | (2) |
|
|
|
676 | (1) |
|
|
|
677 | (15) |
|
|
|
677 | (1) |
|
|
|
677 | (2) |
|
|
|
679 | (2) |
|
|
|
681 | (2) |
|
|
|
683 | (3) |
|
|
|
686 | (1) |
|
|
|
687 | (1) |
|
|
|
687 | (2) |
|
|
|
689 | (1) |
|
|
|
689 | (2) |
|
|
|
691 | (1) |
|
|
|
692 | (13) |
|
|
|
693 | (1) |
|
|
|
693 | (11) |
|
|
|
694 | (1) |
|
|
|
695 | (1) |
|
|
|
695 | (1) |
|
Viewports and Coordinates |
|
|
695 | (1) |
|
|
|
696 | (1) |
|
|
|
697 | (1) |
|
|
|
697 | (4) |
|
|
|
701 | (2) |
|
|
|
703 | (1) |
|
|
|
703 | (1) |
|
|
|
704 | (1) |
|
|
|
705 | (2) |
| Chapter 19 Scripting Forms |
|
707 | (36) |
|
|
|
707 | (8) |
|
|
|
708 | (1) |
|
|
|
709 | (1) |
|
|
|
710 | (5) |
|
Common Form-Field Properties |
|
|
711 | (2) |
|
Common Form-Field Methods |
|
|
713 | (1) |
|
|
|
714 | (1) |
|
|
|
715 | (11) |
|
|
|
716 | (2) |
|
|
|
716 | (1) |
|
|
|
717 | (1) |
|
|
|
717 | (1) |
|
|
|
718 | (3) |
|
|
|
719 | (1) |
|
Dealing with the Clipboard |
|
|
720 | (1) |
|
|
|
721 | (2) |
|
HTML5 Constraint Validation API |
|
|
723 | (3) |
|
|
|
723 | (1) |
|
|
|
723 | (1) |
|
|
|
724 | (1) |
|
|
|
724 | (1) |
|
|
|
725 | (1) |
|
|
|
726 | (1) |
|
|
|
726 | (6) |
|
|
|
728 | (2) |
|
|
|
730 | (1) |
|
|
|
730 | (1) |
|
Moving and Reordering Options |
|
|
731 | (1) |
|
|
|
732 | (2) |
|
|
|
734 | (7) |
|
|
|
734 | (1) |
|
Interacting with Rich Text |
|
|
735 | (3) |
|
|
|
738 | (2) |
|
|
|
740 | (1) |
|
|
|
741 | (2) |
| Chapter 20 Javascript APIS |
|
743 | (80) |
|
Atomics and SharedArrayBuffer |
|
|
744 | (7) |
|
|
|
744 | (1) |
|
|
|
745 | (8) |
|
Atomic Arithmetic and Bitwise Methods |
|
|
745 | (2) |
|
|
|
747 | (1) |
|
|
|
748 | (1) |
|
Atomics Futex Operations and Locks |
|
|
749 | (2) |
|
|
|
751 | (2) |
|
|
|
753 | (5) |
|
|
|
753 | (2) |
|
|
|
753 | (1) |
|
|
|
754 | (1) |
|
|
|
755 | (3) |
|
|
|
755 | (1) |
|
|
|
756 | (2) |
|
|
|
758 | (6) |
|
|
|
758 | (1) |
|
|
|
759 | (2) |
|
|
|
761 | (1) |
|
|
|
761 | (1) |
|
|
|
762 | (1) |
|
Drag-and-Drop File Reading |
|
|
763 | (1) |
|
|
|
764 | (6) |
|
|
|
765 | (2) |
|
|
|
767 | (1) |
|
|
|
768 | (1) |
|
|
|
769 | (1) |
|
|
|
770 | (1) |
|
|
|
770 | (5) |
|
|
|
770 | (1) |
|
|
|
771 | (1) |
|
|
|
772 | (1) |
|
dropEffect and effectAllowed |
|
|
773 | (1) |
|
|
|
774 | (1) |
|
|
|
774 | (1) |
|
|
|
775 | (1) |
|
|
|
775 | (1) |
|
Showing and Hiding Notification |
|
|
775 | (1) |
|
Notification Lifecycle Callbacks |
|
|
776 | (1) |
|
|
|
776 | (1) |
|
|
|
777 | (8) |
|
|
|
778 | (1) |
|
Chunks, Internal Queues, and Backpressure |
|
|
778 | (1) |
|
|
|
779 | (2) |
|
Using the ReadableStreamDefaultController |
|
|
779 | (1) |
|
Using the ReadableStreamDefaultReader |
|
|
780 | (1) |
|
|
|
781 | (1) |
|
Creating a WriteableStream |
|
|
781 | (1) |
|
Using a WritableStreamDefaultWriter |
|
|
781 | (1) |
|
|
|
782 | (2) |
|
|
|
784 | (1) |
|
|
|
785 | (6) |
|
|
|
786 | (2) |
|
|
|
788 | (3) |
|
|
|
788 | (1) |
|
|
|
789 | (1) |
|
|
|
790 | (1) |
|
|
|
791 | (17) |
|
|
|
791 | (4) |
|
|
|
792 | (1) |
|
|
|
793 | (1) |
|
|
|
794 | (1) |
|
|
|
795 | (7) |
|
Introduction to Shadow DOM |
|
|
795 | (1) |
|
|
|
796 | (1) |
|
|
|
797 | (2) |
|
Composition and Shadow DOM Slots |
|
|
799 | (2) |
|
|
|
801 | (1) |
|
|
|
802 | (6) |
|
Defining a Custom Element |
|
|
802 | (2) |
|
Adding Web Component Content |
|
|
804 | (1) |
|
Using Custom Element Lifecycle Hooks |
|
|
805 | (1) |
|
Reflecting Custom Element Attributes |
|
|
806 | (1) |
|
Upgrading Custom Elements |
|
|
807 | (1) |
|
|
|
808 | (14) |
|
|
|
808 | (2) |
|
Using the SubtleCrypto Object |
|
|
810 | (14) |
|
Generating Cryptographic Digests |
|
|
810 | (2) |
|
CryptoKeys and Algorithms |
|
|
812 | (2) |
|
|
|
814 | (2) |
|
Exporting and Importing Keys |
|
|
816 | (1) |
|
Deriving Keys from Master Keys |
|
|
817 | (2) |
|
Signing and Verifying Messages with Asymmetric Keys |
|
|
819 | (1) |
|
Encrypting and Decrypting with Symmetric Keys |
|
|
820 | (1) |
|
Wrapping and Unwrapping a Key |
|
|
821 | (1) |
|
|
|
822 | (1) |
| Chapter 21 Error Handling And Debugging |
|
823 | (26) |
|
|
|
824 | (1) |
|
|
|
824 | (1) |
|
|
|
824 | (1) |
|
|
|
825 | (15) |
|
|
|
825 | (4) |
|
|
|
826 | (1) |
|
|
|
826 | (2) |
|
|
|
828 | (1) |
|
|
|
829 | (2) |
|
|
|
830 | (1) |
|
Throwing Errors versus try-catch |
|
|
831 | (1) |
|
|
|
831 | (1) |
|
Error-Handling Strategies |
|
|
832 | (1) |
|
Identify Where Errors Might Occur |
|
|
833 | (5) |
|
|
|
833 | (1) |
|
|
|
833 | (2) |
|
|
|
835 | (2) |
|
|
|
837 | (1) |
|
Distinguishing between Fatal and Nonfatal Errors |
|
|
838 | (1) |
|
|
|
839 | (1) |
|
|
|
840 | (4) |
|
Logging Messages to a Console |
|
|
840 | (1) |
|
Understanding the Console Runtime |
|
|
841 | (1) |
|
Using the JavaScript Debugger |
|
|
842 | (1) |
|
Logging Messages to the Page |
|
|
842 | (1) |
|
|
|
843 | (1) |
|
|
|
843 | (1) |
|
Common Legacy Internet Explorer Errors |
|
|
844 | (2) |
|
|
|
844 | (1) |
|
|
|
845 | (1) |
|
|
|
845 | (1) |
|
|
|
845 | (1) |
|
The System Cannot Locate the Resource Specified |
|
|
846 | (1) |
|
|
|
846 | (3) |
| Chapter 22 XML In Javascript |
|
849 | (12) |
|
XML DOM Support in Browsers |
|
|
849 | (3) |
|
|
|
850 | (1) |
|
|
|
850 | (1) |
|
|
|
851 | (1) |
|
XPath Support in Browsers |
|
|
852 | (5) |
|
|
|
852 | (2) |
|
|
|
854 | (1) |
|
|
|
854 | (1) |
|
|
|
855 | (1) |
|
|
|
856 | (1) |
|
|
|
857 | (2) |
|
|
|
857 | (1) |
|
|
|
858 | (1) |
|
|
|
859 | (1) |
|
|
|
859 | (2) |
| Chapter 23 JSON |
|
861 | (10) |
|
|
|
862 | (2) |
|
|
|
862 | (1) |
|
|
|
862 | (1) |
|
|
|
863 | (1) |
|
Parsing and Serialization |
|
|
864 | (6) |
|
|
|
865 | (1) |
|
|
|
866 | (3) |
|
|
|
866 | (1) |
|
|
|
867 | (1) |
|
|
|
868 | (1) |
|
|
|
869 | (1) |
|
|
|
870 | (1) |
| Chapter 24 Network Requests And Remote Resources |
|
871 | (48) |
|
The XMLHttpRequest Object |
|
|
872 | (6) |
|
|
|
872 | (3) |
|
|
|
875 | (1) |
|
|
|
876 | (1) |
|
|
|
877 | (1) |
|
|
|
878 | (2) |
|
|
|
878 | (1) |
|
|
|
879 | (1) |
|
The overrideMimeType() Method |
|
|
879 | (1) |
|
|
|
880 | (1) |
|
|
|
880 | (1) |
|
|
|
881 | (1) |
|
Cross-Origin Resource Sharing |
|
|
881 | (3) |
|
|
|
883 | (1) |
|
|
|
883 | (1) |
|
Alternate Cross-Domain Techniques |
|
|
884 | (1) |
|
|
|
884 | (1) |
|
|
|
884 | (1) |
|
|
|
885 | (29) |
|
|
|
886 | (7) |
|
|
|
886 | (1) |
|
|
|
886 | (1) |
|
Handling Status Codes and Request Failures |
|
|
887 | (1) |
|
|
|
888 | (5) |
|
|
|
893 | (2) |
|
|
|
893 | (1) |
|
Sending Parameters in a Request Body |
|
|
893 | (1) |
|
|
|
893 | (1) |
|
|
|
894 | (1) |
|
Sending a Cross-Origin Request |
|
|
894 | (1) |
|
|
|
894 | (1) |
|
|
|
895 | (2) |
|
Exploring Headers-Map Similarity |
|
|
895 | (1) |
|
Unique Features of the Headers Object |
|
|
896 | (1) |
|
|
|
896 | (1) |
|
|
|
897 | (4) |
|
|
|
897 | (1) |
|
|
|
898 | (2) |
|
Using Request Objects with fetch() |
|
|
900 | (1) |
|
|
|
901 | (5) |
|
Creating Response Objects |
|
|
901 | (2) |
|
Reading Response Status Information |
|
|
903 | (2) |
|
|
|
905 | (1) |
|
Requests, Responses, and the Body Mixin |
|
|
906 | (9) |
|
|
|
906 | (1) |
|
|
|
906 | (1) |
|
|
|
907 | (1) |
|
|
|
907 | (1) |
|
|
|
908 | (1) |
|
|
|
908 | (1) |
|
Using a ReadableStream Body |
|
|
909 | (5) |
|
|
|
914 | (1) |
|
|
|
915 | (2) |
|
|
|
915 | (1) |
|
|
|
916 | (1) |
|
|
|
916 | (1) |
|
|
|
917 | (1) |
|
|
|
918 | (1) |
| Chapter 25 Client-Side Storage |
|
919 | (26) |
|
|
|
919 | (10) |
|
|
|
920 | (1) |
|
|
|
921 | (1) |
|
|
|
922 | (3) |
|
|
|
925 | (3) |
|
|
|
928 | (1) |
|
|
|
929 | (4) |
|
|
|
929 | (1) |
|
The sessionStorage Object |
|
|
930 | (2) |
|
|
|
932 | (1) |
|
|
|
932 | (1) |
|
|
|
933 | (1) |
|
|
|
933 | (11) |
|
|
|
933 | (1) |
|
|
|
934 | (1) |
|
|
|
935 | (1) |
|
|
|
936 | (1) |
|
|
|
937 | (2) |
|
|
|
939 | (1) |
|
|
|
940 | (1) |
|
|
|
941 | (2) |
|
|
|
943 | (1) |
|
|
|
943 | (1) |
|
|
|
944 | (1) |
| Chapter 26 Modules |
|
945 | (24) |
|
Understanding the module pattern |
|
|
946 | (4) |
|
|
|
946 | (1) |
|
|
|
946 | (1) |
|
|
|
946 | (1) |
|
|
|
947 | (1) |
|
Asynchronous Dependencies |
|
|
948 | (1) |
|
Programmatic Dependencies |
|
|
948 | (1) |
|
|
|
948 | (1) |
|
|
|
949 | (1) |
|
Improvising Module Systems |
|
|
950 | (3) |
|
Working with pre-ES6 module loaders |
|
|
953 | (5) |
|
|
|
953 | (3) |
|
Asynchronous Module Definition |
|
|
956 | (1) |
|
Universal Module Definition |
|
|
957 | (1) |
|
Module Loader Deprecation |
|
|
957 | (1) |
|
|
|
958 | (9) |
|
Module Tagging and Definition |
|
|
958 | (1) |
|
|
|
959 | (1) |
|
|
|
959 | (1) |
|
|
|
960 | (3) |
|
|
|
963 | (2) |
|
Module Passthrough Exports |
|
|
965 | (1) |
|
|
|
965 | (1) |
|
|
|
966 | (1) |
|
|
|
967 | (2) |
| Chapter 27 Workers |
|
969 | (66) |
|
|
|
970 | (3) |
|
Comparing Workers and Threads |
|
|
970 | (1) |
|
|
|
971 | (1) |
|
|
|
971 | (1) |
|
|
|
971 | (1) |
|
|
|
971 | (1) |
|
|
|
971 | (2) |
|
WorkerGlobalScope Properties and Methods |
|
|
972 | (1) |
|
Subclasses of WorkerGlobalScope |
|
|
972 | (1) |
|
|
|
973 | (24) |
|
|
|
973 | (3) |
|
Creating a Dedicated Worker |
|
|
973 | (1) |
|
Worker Security Restrictions |
|
|
974 | (1) |
|
|
|
975 | (1) |
|
The Dedicated WorkerGlobalScope |
|
|
976 | (1) |
|
Dedicated Workers and Implicit Message Ports |
|
|
976 | (1) |
|
Understanding the Dedicated Worker Lifecycle |
|
|
977 | (2) |
|
Configuring Worker Options |
|
|
979 | (1) |
|
Creating a Worker from Inline JavaScript |
|
|
979 | (1) |
|
Dynamic Script Execution Inside a Worker |
|
|
980 | (2) |
|
Delegating Tasks to Subworkers |
|
|
982 | (1) |
|
|
|
983 | (1) |
|
Communicating with a Dedicated Worker |
|
|
983 | (4) |
|
Communicating with postMessage() |
|
|
983 | (1) |
|
Communicating with MessageChannel |
|
|
984 | (2) |
|
Communicating with BroadcastChannel |
|
|
986 | (1) |
|
|
|
987 | (6) |
|
Structured Clone Algorithm |
|
|
987 | (1) |
|
|
|
988 | (2) |
|
|
|
990 | (3) |
|
|
|
993 | (4) |
|
|
|
997 | (6) |
|
|
|
997 | (3) |
|
|
|
997 | (1) |
|
Shared Worker Identity and Single Occupancy |
|
|
998 | (1) |
|
Using the Shared Worker Object |
|
|
999 | (1) |
|
The SharedWorkerGlobalScope |
|
|
999 | (1) |
|
Understanding the Shared Worker Lifecycle |
|
|
1000 | (1) |
|
Connecting to a Shared Worker |
|
|
1001 | (2) |
|
|
|
1003 | (30) |
|
|
|
1003 | (5) |
|
The Service Worker Container |
|
|
1004 | (1) |
|
Creating a Service Worker |
|
|
1004 | (1) |
|
Using the Service Worker Container Object |
|
|
1005 | (1) |
|
Using the Service Worker Registration Object |
|
|
1006 | (1) |
|
Using the Service Worker Object |
|
|
1007 | (1) |
|
Service Worker Security Restrictions |
|
|
1008 | (1) |
|
The Service Worker Global Scope |
|
|
1008 | (9) |
|
Service Worker Scope Limitations |
|
|
1010 | (2) |
|
|
|
1012 | (1) |
|
|
|
1013 | (1) |
|
|
|
1014 | (3) |
|
|
|
1017 | (1) |
|
|
|
1017 | (1) |
|
Service Workers and Consistency |
|
|
1018 | (1) |
|
Understanding the Service Worker Lifecycle |
|
|
1019 | (5) |
|
|
|
1020 | (1) |
|
|
|
1020 | (1) |
|
|
|
1021 | (1) |
|
|
|
1022 | (1) |
|
|
|
1023 | (1) |
|
|
|
1024 | (1) |
|
Updating a Service Worker |
|
|
1024 | (1) |
|
Inversion of Control and Service Worker Persistence |
|
|
1024 | (1) |
|
Managing Service Worker File Caching with updateViaCache |
|
|
1025 | (1) |
|
Forced Service Worker Operation |
|
|
1025 | (1) |
|
|
|
1026 | (2) |
|
Intercepting a fetch Event |
|
|
1028 | (2) |
|
|
|
1028 | (1) |
|
|
|
1029 | (1) |
|
Return from Network with Cache Fallback |
|
|
1029 | (1) |
|
Return from Cache with Network Fallback |
|
|
1029 | (1) |
|
|
|
1029 | (1) |
|
|
|
1030 | (5) |
|
|
|
1030 | (1) |
|
Handling Notification Events |
|
|
1031 | (1) |
|
Subscribing to Push Events |
|
|
1031 | (1) |
|
|
|
1032 | (1) |
|
|
|
1033 | (2) |
| Chapter 28 Best Practices |
|
1035 | (32) |
|
|
|
1035 | (12) |
|
What Is Maintainable Code? |
|
|
1036 | (1) |
|
|
|
1036 | (3) |
|
|
|
1037 | (1) |
|
Variable and Function Naming |
|
|
1037 | (1) |
|
Variable Type Transparency |
|
|
1038 | (1) |
|
|
|
1039 | (4) |
|
|
|
1039 | (2) |
|
|
|
1041 | (1) |
|
Decouple Application Logic/Event Handlers |
|
|
1041 | (2) |
|
|
|
1043 | (4) |
|
|
|
1043 | (1) |
|
|
|
1044 | (1) |
|
|
|
1045 | (1) |
|
|
|
1046 | (1) |
|
|
|
1047 | (12) |
|
|
|
1047 | (2) |
|
|
|
1047 | (1) |
|
|
|
1048 | (1) |
|
Choose the Right Approach |
|
|
1049 | (5) |
|
Avoid Unnecessary Property Lookup |
|
|
1049 | (1) |
|
|
|
1050 | (1) |
|
|
|
1051 | (2) |
|
Avoid Double Interpretation |
|
|
1053 | (1) |
|
Other Performance Considerations |
|
|
1054 | (1) |
|
|
|
1054 | (2) |
|
Multiple Variable Declarations |
|
|
1054 | (1) |
|
|
|
1055 | (1) |
|
Use Array and Object Literals |
|
|
1055 | (1) |
|
Optimize DOM Interactions |
|
|
1056 | (3) |
|
|
|
1056 | (1) |
|
|
|
1057 | (1) |
|
|
|
1058 | (1) |
|
Beware of HTMLCollections |
|
|
1058 | (1) |
|
|
|
1059 | (5) |
|
|
|
1059 | (2) |
|
|
|
1060 | (1) |
|
|
|
1060 | (1) |
|
|
|
1060 | (1) |
|
|
|
1061 | (1) |
|
|
|
1061 | (1) |
|
|
|
1062 | (2) |
|
|
|
1062 | (1) |
|
|
|
1063 | (1) |
|
|
|
1063 | (1) |
|
|
|
1064 | (1) |
|
|
|
1064 | (3) |
| Appendix A: ES2018 And ES2019 |
|
1067 | (20) |
| Appendix B: Strict Mode |
|
1087 | (8) |
| Appendix C: Javascript Libraries And Frameworks |
|
1095 | (6) |
| Appendix D: Javascript Tools |
|
1101 | (12) |
| Index |
|
1113 | |