Muutke küpsiste eelistusi

Professional JavaScript for Web Developers 4th edition [Pehme köide]

  • Formaat: Paperback / softback, 1200 pages, kõrgus x laius x paksus: 236x185x64 mm, kaal: 1950 g
  • Ilmumisaeg: 25-Nov-2019
  • Kirjastus: Wrox Press
  • ISBN-10: 1119366445
  • ISBN-13: 9781119366447
Teised raamatud teemal:
  • Pehme köide
  • Hind: 42,70 €*
  • * hind on lõplik, st. muud allahindlused enam ei rakendu
  • Tavahind: 50,24 €
  • Säästad 15%
  • Raamatu kohalejõudmiseks kirjastusest kulub orienteeruvalt 3-4 nädalat
  • Kogus:
  • Lisa ostukorvi
  • Tasuta tarne
  • Tellimisaeg 2-4 nädalat
  • Lisa soovinimekirja
  • Raamatukogudele
  • Formaat: Paperback / softback, 1200 pages, kõrgus x laius x paksus: 236x185x64 mm, kaal: 1950 g
  • Ilmumisaeg: 25-Nov-2019
  • Kirjastus: Wrox Press
  • ISBN-10: 1119366445
  • ISBN-13: 9781119366447
Teised raamatud teemal:
Update your skill set for ES 6 and 7 with the ultimate JavaScript guide for pros

Professional JavaScript for Web Developers is the essential guide to next-level JavaScript development. Written for intermediate-to-advanced programmers, this book jumps right into the technical details to help you clean up your code and become a more sophisticated JavaScript developer. From JavaScript-specific object-oriented programming and inheritance, to combining JavaScript with HTML and other markup languages, expert instruction walks you through the fundamentals and beyond. This new fourth edition has been updated to cover ECMAScript 6 and 7 (also known as ES2015 and ES2016) and the major re-imagination and departure from ES 5.1; new frameworks and libraries, new techniques, new testing tools, and more are explained in detail for the professional developer, with a practical focus that helps you put your new skills to work on real-world projects.

The latest—and most dramatic—ES release is already being incorporated into JavaScript engines in major browsers; this, coupled with the rise in mobile web traffic increasing demand for responsive, dynamic web design, means that all web developers need to update their skills—and this book is your ideal resource for quick, relevant guidance.

  • Get up to date with ECMAScript 6 and 7, new frameworks, and new libraries
  • Delve into web animation, emerging APIs, and build systems
  • Test more effectively with mocks, unit tests, functional tests, and other tools
  • Plan your builds for future ES releases

Even if you think you know JavaScript, new ES releases bring big changes that will affect the way you work. For a professional-level update that doesn't waste time on coding fundamentals, Professional JavaScript for Web Developers is the ultimate resource to bring you up to speed.

Foreword xlvii
Introduction xlix
Chapter 1 What Is Javascript? 1(12)
A Short History
2(1)
JavaScript Implementations
3(8)
ECMAScript
3(4)
ECMAScript Editions
4(1)
What Does ECMAScript Conformance Mean?
5(1)
ECMAScript Support in Web Browsers
5(2)
The Document Object Model
7(3)
Why the DOM Is Necessary
8(1)
DOM Levels
8(1)
Other DOMs
9(1)
DOM Support in Web Browsers
9(1)
The Browser Object Model
10(1)
JavaScript Versions
11(1)
Summary
12(1)
Chapter 2 Javascript In HTML 13(12)
The script Element
13(8)
Tag Placement
16(1)
Deferred Scripts
17(1)
Asynchronous Scripts
17(1)
Dynamic Script Loading
18(1)
Changes in XHTML
19(1)
Deprecated Syntax
20(1)
Inline Code versus External Files
21(1)
Document Modes
22(1)
The noscript Element
23(1)
Summary
24(1)
Chapter 3 Language Basics 25(76)
Syntax
25(3)
Case-Sensitivity
26(1)
Identifiers
26(1)
Comments
26(1)
Strict Mode
27(1)
Statements
27(1)
Keywords and Reserved Words
28(1)
Variables
29(7)
The 'var' Keyword
29(2)
var Declaration Scope
29(1)
var Declaration Hoisting
30(1)
'let' Declarations
31(3)
Temporal Dead Zone
32(1)
Global Declarations
32(1)
Conditional Declaration
32(2)
let Declaration in for Loops
34(1)
'const' Declarations
34(1)
Declaration Styles and Best Practices
35(1)
Don't Use var
36(1)
Prefer const Over let
36(1)
Data Types
36(32)
The typeof Operator
36(1)
The Undefined Type
37(2)
The Null Type
39(1)
The Boolean Type
40(1)
The Number Type
41(5)
Floating-Point Values
41(1)
Range of Values
42(1)
NaN
43(1)
Number Conversions
44(2)
The String Type
46(8)
Character Literals
47(1)
The Nature of Strings
48(1)
Converting to a String
48(1)
Template Literals
49(1)
Interpolation
50(1)
Template Literal Tag Functions
51(2)
Raw Strings
53(1)
The Symbol Type
54(13)
Basic Symbol Use
54(1)
Using the Global Symbol Registry
55(1)
Using Symbols as Properties
56(1)
Well-Known Symbols
57(10)
The Object Type
67(1)
Operators
68(22)
Unary Operators
68(4)
Increment/Decrement
68(2)
Unary Plus and Minus
70(2)
Bitwise Operators
72(5)
Bitwise NOT
73(1)
Bitwise AND
74(1)
Bitwise OR
74(1)
Bitwise XOR
75(1)
Left Shift
76(1)
Signed Right Shift
76(1)
Unsigned Right Shift
76(1)
Boolean Operators
77(3)
Logical NOT
77(1)
Logical AND
78(1)
Logical OR
79(1)
Multiplicative Operators
80(2)
Multiply
80(1)
Divide
81(1)
Modulus
82(1)
Exponentiation Operator
82(1)
Additive Operators
82(3)
Add
83(1)
Subtract
84(1)
Relational Operators
85(1)
Equality Operators
86(2)
Equal and Not Equal
86(1)
Identically Equal and Not Identically Equal
87(1)
Conditional Operator
88(1)
Assignment Operators
88(1)
Comma Operator
89(1)
Statements
90(8)
The if Statement
90(1)
The do-while Statement
90(1)
The while Statement
91(1)
The for Statement
91(1)
The for-in Statement
92(1)
The for-of Statement
93(1)
Labeled Statements
93(1)
The break and continue Statements
94(1)
The with Statement
95(1)
The switch Statement
96(2)
Functions
98(2)
Summary
100(1)
Chapter 4 Variables, Scope, And Memory 101(24)
Primitive and Reference Values
101(5)
Dynamic Properties
102(1)
Copying Values
103(1)
Argument Passing
103(2)
Determining Type
105(1)
Execution Context and Scope
106(8)
Scope Chain Augmentation
108(1)
Variable Declaration
109(5)
Function Scope Declaration Using var
109(2)
Block Scope Declaration Using let
111(1)
Constant Declaration Using const
112(1)
Identifier Lookup
113(1)
Garbage Collection
114(8)
Mark-and-Sweep
115(1)
Reference Counting
115(1)
Performance
116(1)
Managing Memory
117(9)
Performance Boosts with const and let Declarations
118(1)
Hidden Classes and the delete Operation
118(1)
Memory Leaks
119(1)
Static Allocation and Object Pools
120(2)
Summary
122(3)
Chapter 5 Basic Reference Types 125(42)
The Date Type
126(5)
Inherited Methods
128(1)
Date-Formatting Methods
129(1)
Date/Time Component Methods
129(2)
The RegExp Type
131(8)
RegExp Instance Properties
134(1)
RegExp Instance Methods
135(2)
RegExp Constructor Properties
137(2)
Pattern Limitations
139(1)
Primitive Wrapper Types
139(18)
The Boolean Type
141(1)
The Number Type
141(3)
The isInteger() Method and Safe Integers
143(1)
The String Type
144(13)
The JavaScript Character
144(3)
The normalize() Method
147(1)
String-Manipulation Methods
148(2)
String Location Methods
150(1)
String Inclusion Methods
151(1)
The trim() Method
151(1)
The repeat() Method
152(1)
The padStart() and padEnd() Methods
152(1)
String Iterators and Destructuring
152(1)
String Case Methods
153(1)
String Pattern-Matching Methods
153(3)
The localeCompare() Method
156(1)
HTML Methods
157(1)
Singleton Built-in Objects
157(8)
The Global Object
157(4)
URI-Encoding Methods
158(1)
The eval() Method
159(1)
Global Object Properties
160(1)
The Window Object
161(1)
The Math Object
161(9)
Math Object Properties
162(1)
The min() and max() Methods
162(1)
Rounding Methods
163(1)
The random() Method
163(1)
Other Methods
164(1)
Summary
165(2)
Chapter 6 Collection Reference Types 167(58)
The Object Type
167(3)
The Array Type
170(20)
Creating Arrays
170(2)
Array Holes
172(2)
Indexing into Arrays
174(1)
Detecting Arrays
175(1)
Iterator Methods
176(1)
Copy and Fill Methods
176(3)
Conversion Methods
179(1)
Stack Methods
180(1)
Queue Methods
181(1)
Reordering Methods
182(2)
Manipulation Methods
184(2)
Search and Location Methods
186(2)
Strict Equivalence
186(1)
Predicate Search
187(1)
Iterative Methods
188(1)
Reduction Methods
189(1)
Typed Arrays
190(11)
History
190(1)
WebGL
190(1)
Emergence of Typed Arrays
191(1)
Using ArrayBuffers
191(1)
DataViews
192(4)
ElementType
193(1)
Big-Endian and Little-Endian
194(1)
Corner Cases
195(1)
Typed Arrays
196(5)
Typed Array Behavior
197(1)
Merging, Copying, and Changing Typed Arrays
198(2)
Underflow and Overflow
200(1)
The Map Type
201(5)
Basic API
201(2)
Order and Iteration
203(3)
Choosing Between Objects and Maps
206(1)
Memory Profile
206(1)
Insertion Performance
206(1)
Lookup Performance
206(1)
Delete Performance
206(1)
The WeakMap Type
206(5)
Basic API
207(1)
Weak Keys
208(1)
Non-Iterable Keys
209(1)
Utility
209(2)
Private Variables
209(2)
DOM Node Metadata
211(1)
The Set Type
211(6)
Basic API
211(2)
Order and Iteration
213(2)
Defining Formal Set Operations
215(2)
The WeakSet Type
217(3)
Basic API
217(2)
Weak Keys
219(1)
Non-Iterable Values
219(1)
Utility
219(1)
Iteration and Spread Operators
220(2)
Summary
222(3)
Chapter 7 Iterators And Generators 225(26)
Introduction to Iteration
225(1)
The Iterator Pattern
226(10)
The Iterable Protocol
227(2)
The Iterator Protocol
229(2)
Custom Iterator Definition
231(2)
Early Termination of Iterators
233(3)
Generators
236(13)
Generator Basics
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)
Yielding an Iterable
242(2)
Recursive Algorithms Using yield
244(2)
Using a Generator as the Default Iterator
246(1)
Early Termination of Generators
247(4)
The return() Method
247(1)
The throw() Method
248(1)
Summary
249(2)
Chapter 8 Objects, Classes, And Object-Oriented Programming 251(72)
Understanding Objects
251(17)
Types of Properties
252(3)
Data Properties
252(2)
Accessor Properties
254(1)
Defining Multiple Properties
255(1)
Reading Property Attributes
256(1)
Merging Objects
257(3)
Object Identity and Equality
260(1)
Enhanced Object Syntax
261(3)
Property Value Shorthand
261(1)
Computed Property Keys
262(1)
Concise Method Syntax
263(1)
Object Destructuring
264(4)
Nested Destructuring
266(1)
Partial Destructuring Completion
267(1)
Parameter Context Matching
268(1)
Object Creation
268(21)
Overview
268(1)
The Factory Pattern
269(1)
The Function Constructor Pattern
269(4)
Constructors as Functions
272(1)
Problems with Constructors
272(1)
The Prototype Pattern
273(11)
How Prototypes Work
274(4)
Understanding the Prototype Hierarchy
278(3)
Prototypes and the "in" Operator
281(2)
Property Enumeration Order
283(1)
Object Iteration
284(5)
Alternate Prototype Syntax
285(1)
Dynamic Nature of Prototypes
286(1)
Native Object Prototypes
287(1)
Problems with Prototypes
288(1)
Inheritance
289(13)
Prototype Chaining
289(5)
Default Prototypes
291(1)
Prototype and Instance Relationships
291(1)
Working with Methods
292(2)
Problems with Prototype Chaining
294(1)
Constructor Stealing
294(2)
Passing Arguments
295(1)
Problems with Constructor Stealing
296(1)
Combination Inheritance
296(1)
Prototypal Inheritance
297(1)
Parasitic Inheritance
298(1)
Parasitic Combination Inheritance
299(3)
Classes
302(18)
Class Definition Basics
302(1)
Class Composition
303(1)
The Class Constructor
303(4)
Instantiation
304(2)
Understanding Classes as Special Functions
306(1)
Instance, Prototype, and Class Members
307(5)
Instance Members
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)
Inheritance
312(12)
Inheritance Basics
312(1)
Constructors, HomeObjects, and super()
313(3)
Abstract Base Classes
316(1)
Inheriting from Built-in Types
317(1)
Class Mixins
318(2)
Summary
320(3)
Chapter 9 Proxies And Reflect 323(26)
Proxy Fundamentals
324(9)
Creating a Passthrough Proxy
324(1)
Defining Traps
325(1)
Trap Parameters and the Reflect API
326(2)
Trap Invariants
328(1)
Revocable Proxies
329(1)
Utility of the Reflect API
329(2)
Reflect API vs. Object API
330(1)
Status Flags
330(1)
Supplanting Operators with First-Class Functions
331(1)
Safe Function Application
331(1)
Proxying a Proxy
331(1)
Proxy Considerations and Shortcomings
332(1)
'this' Inside a Proxy
332(1)
Proxies and Internal Slots
333(1)
Proxy Traps and Reflect Methods
333(11)
get()
333(1)
Return value
334(1)
Intercepted operations
334(1)
Trap handler parameters
334(1)
Trap invariants
334(1)
set()
334(1)
Return value
335(1)
Intercepted operations
335(1)
Trap handler parameters
335(1)
Trap invariants
335(1)
has()
335(1)
Return value
336(1)
Intercepted operations
336(1)
Trap handler parameters
336(1)
Trap invariants
336(1)
defineProperty()
336(1)
Return value
336(1)
Intercepted operations
336(1)
Trap handler parameters
337(1)
Trap invariants
337(1)
getOwnPropertyDescriptor()
337(1)
Return value
337(1)
Intercepted operations
337(1)
Trap handler parameters
337(1)
Trap invariants
338(1)
deleteProperty()
338(1)
Return value
338(1)
Intercepted operations
338(1)
Trap handler parameters
338(1)
Trap invariants
339(1)
own Keys()
339(1)
Return value
339(1)
Intercepted operations
339(1)
Trap handler parameters
339(1)
Trap invariants
339(1)
getPrototypeOf()
339(1)
Return value
340(1)
Intercepted operations
340(1)
Trap handler parameters
340(1)
Trap invariants
340(1)
setPrototypeOf()
340(1)
Return value
341(1)
Intercepted operations
341(1)
Trap handler parameters
341(1)
Trap invariants
341(1)
isExtensible()
341(1)
Return value
341(1)
Intercepted operations
341(1)
Trap handler parameters
342(1)
Trap invariants
342(1)
preventExtensions()
342(1)
Return value
342(1)
Intercepted operations
342(1)
Trap handler parameters
342(1)
Trap invariants
342(1)
apply()
342(1)
Return value
343(1)
Intercepted operations
343(1)
Trap handler parameters
343(1)
Trap invariants
343(1)
construct()
343(1)
Return value
343(1)
Intercepted operations
344(1)
Trap handler parameters
344(1)
Trap invariants
344(1)
Proxy Patterns
344(4)
Tracking Property Access
344(1)
Hidden Properties
345(1)
Property Validation
345(1)
Function and Constructor Parameter Validation
346(1)
Data Binding and Observables
347(1)
Summary
348(1)
Chapter 10 Functions 349(42)
Arrow Functions
350(1)
Function Names
351(2)
Understanding Arguments
353(2)
Arguments in Arrow Functions
355(1)
No Overloading
355(1)
Default Parameter Values
356(3)
Default Parameter Scope and Temporal Dead Zone
358(1)
Spread Arguments and Rest Parameters
359(2)
Spread Arguments
359(1)
Rest Parameter
360(1)
Function Declarations versus Function Expressions
361(1)
Functions as Values
362(2)
Function Internals
364(3)
arguments
364(1)
this
365(1)
caller
366(1)
new.target
367(1)
Function Properties and Methods
367(3)
Function Expressions
370(2)
Recursion
372(1)
Tail Call Optimization
373(16)
Tail Call Optimization Requirements
374(1)
Coding for Tail Call Optimization
375(1)
Closures
376(6)
The this Object
379(2)
Memory Leaks
381(1)
Immediately Invoked Function Expressions
382(2)
Private Variables
384(8)
Static Private Variables
385(2)
The Module Pattern
387(1)
The Module-Augmentation Pattern
388(1)
Summary
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)
Handling Failure
394(1)
Nesting Asynchronous Callbacks
394(1)
Promises
395(26)
The Promises/A+ Specification
395(1)
Promise Basics
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)
Promise Instance Methods
400(10)
Implementing the Thenable Interface
400(1)
Promise.prototype.then()
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)
Promise Chaining
410(3)
Promise Graphs
413(1)
Parallel Promise Composition with Promise.all() and Promise.race()
414(2)
Serial Promise Composition
416(2)
Promise Extensions
418(3)
Promise Canceling
418(1)
Promise Progress Notifications
419(2)
Async Functions
421(14)
Async Function Basics
422(5)
The async keyword
422(2)
The await keyword
424(2)
Restrictions on await
426(1)
Halting and Resuming Execution
427(3)
Strategies for Async Functions
430(8)
Implementing Sleep()
430(1)
Maximizing Parallelization
431(3)
Serial Promise Execution
434(1)
Stack Traces and Memory Management
434(1)
Summary
435(2)
Chapter 12 The Browser Object Model 437(28)
The window Object
438(12)
The Global Scope
438(1)
Window Relationships
439(1)
Window Position and Pixel Ratio
439(1)
Pixel Ratios
439(1)
Window Size
440(1)
Window Viewport Position
441(1)
Navigating and Opening Windows
442(4)
Popping Up Windows
442(3)
Security Restrictions
445(1)
Pop-up Blockers
445(1)
Intervals and Timeouts
446(2)
System Dialogs
448(2)
The location Object
450(4)
Query String Arguments
451(1)
URLSearchParams
452(1)
Manipulating the Location
452(2)
The navigator Object
454(5)
Detecting Plug-ins
456(3)
Legacy Internet Explorer Plugin Detection
457(2)
Registering Handlers
459(1)
The screen Object
459(1)
The history Object
460(2)
Navigation
460(1)
History State Management
461(1)
Summary
462(3)
Chapter 13 Client Detection 465(26)
Capability Detection
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)
User-Agent Detection
470(10)
History of User-Agent Composition
470(8)
Early Browsers
470(1)
Netscape Navigator 3 and Internet Explorer 3
471(1)
Netscape Communicator 4 and Internet Explorer 4 Through 8
472(1)
Gecko
473(2)
WebKit
475(1)
Konqueror
476(1)
Chrome
476(1)
Opera
476(2)
iOS and Android
478(1)
Using User-Agent for Browser Analysis
478(2)
Spoofing a User-Agent
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)
Browser Metadata
482(7)
The Geolocation API
483(3)
Connection State and the NetworkInformation API
486(1)
Battery Status API
487(2)
Hardware
489(3)
Processor Cores
489(1)
Device Memory
489(1)
Maximum Touch Points
489(1)
Summary
489(2)
Chapter 14 The Document Object Model 491(52)
Hierarchy of Nodes
492(29)
The Node Type
492(6)
The nodeName and nodeValue Properties
493(1)
Node Relationships
494(1)
Manipulating Nodes
495(2)
Other Methods
497(1)
The Document Type
498(8)
Document Children
498(1)
Document Information
499(1)
Locating Elements
500(2)
Special Collections
502(1)
DOM Conformance Detection
503(1)
Document Writing
504(2)
The Element Type
506(8)
HTML Elements
507(3)
Getting Attributes
510(1)
Setting Attributes
511(1)
The attributes Property
511(2)
Creating Elements
513(1)
Element Children
513(1)
The Text Type
514(3)
Creating Text Nodes
515(1)
Normalizing Text Nodes
516(1)
Splitting Text Nodes
517(1)
The Comment Type
517(1)
The CDATASection Type
518(1)
The DocumentType Type
518(1)
The DocumentFragment Type
519(1)
The Attr Type
520(1)
Working with the DOM
521(8)
Dynamic Scripts
521(2)
Dynamic Styles
523(2)
Manipulating Tables
525(3)
Using NodeLists
528(1)
Mutation Observers
529(13)
Basic usage
529(5)
The observe() method
529(1)
Working with Callbacks and MutationRecords
530(2)
The disconnect() method
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)
The takeRecords() method
541(1)
Performance, Memory, and Garbage Collection
541(3)
MutationObserver References
541(1)
MutationRecord References
542(1)
Summary
542(1)
Chapter 15 DOM Extensions 543(20)
Selectors API
544(2)
The querySelector() Method
544(1)
The querySelectorAll() Method
544(1)
The matches() Method
545(1)
Element Traversal
546(1)
HTML5
547(10)
Class-Related Additions
547(2)
The getElementsByClassName() Method
547(1)
The classList Property
548(1)
Focus Management
549(1)
Changes to HTMLDocument
550(1)
The readyState Property
550(1)
Compatibility Mode
550(1)
The head Property
551(1)
Character Set Properties
551(1)
Custom Data Attributes
551(1)
Markup Insertion
552(4)
The innerHTML Property
552(1)
Using innerHTML in Legacy Internet Explorer
553(1)
The outerHTML Property
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)
Proprietary Extensions
557(3)
The children Property
557(1)
The contains() Method
557(1)
Markup Insertion
558(2)
The innerText Property
558(2)
The outerText Property
560(1)
Scrolling
560(1)
Summary
560(3)
Chapter 16 DOM Levels 2 And 3 563(38)
DOM Changes
564(8)
XML Namespaces
564(4)
Changes to Node
566(1)
Changes to Document
567(1)
Changes to Element
567(1)
Changes to NamedNodeMap
568(1)
Other Changes
568(4)
Changes to DocumentType
568(1)
Changes to Document
569(1)
Changes to Node
570(1)
Changes to iframes
571(1)
Styles
572(12)
Accessing Element Styles
572(4)
DOM Style Properties and Methods
573(2)
Computed Styles
575(1)
Working with Style Sheets
576(3)
CSS Rules
577(1)
Creating Rules
578(1)
Deleting Rules
579(1)
Element Dimensions
579(5)
Offset Dimensions
579(2)
Client Dimensions
581(1)
Scroll Dimensions
582(2)
Determining Element Dimensions
584(1)
Traversals
584(6)
Nodelterator
585(3)
TreeWalker
588(2)
Ranges
590(9)
Ranges in the DOM
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)
Collapsing a DOM Range
597(1)
Comparing DOM Ranges
597(1)
Cloning DOM Ranges
598(1)
Cleanup
598(1)
Summary
599(2)
Chapter 17 Events 601(70)
Event Flow
602(2)
Event Bubbling
602(1)
Event Capturing
603(1)
DOM Event Flow
603(1)
Event Handlers
604(7)
HTML Event Handlers
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)
The Event Object
611(8)
The DOM Event Object
611(4)
The Internet Explorer Event Object
615(2)
The Cross-Browser Event Object
617(2)
Event Types
619(40)
UI Events
619(5)
The load Event
620(2)
The unload Event
622(1)
The resize Event
623(1)
The scroll Event
624(1)
Focus Events
624(1)
Mouse and Wheel Events
625(9)
Client Coordinates
627(1)
Page Coordinates
628(1)
Screen Coordinates
628(1)
Modifier Keys
629(1)
Related Elements
630(1)
Buttons
631(1)
Additional Event Information
632(1)
The mousewheel Event
633(1)
Touch Device Support
633(1)
Accessibility Issues
634(1)
Keyboard and Text Events
634(6)
Key Codes
635(1)
Character Codes
636(1)
DOM Level 3 Changes
637(1)
The textInput Event
638(1)
Keyboard Events on Devices
639(1)
Composition Events
640(1)
Mutation Events
641(1)
HTML5 Events
641(6)
The contextmenu Event
641(2)
The beforeunload Event
643(1)
The DOMContentLoaded Event
643(1)
The readystatechange Event
644(1)
The pageshow and pagehide Events
645(2)
The hashchange Event
647(1)
Device Events
647(4)
The orientationchange Event
647(1)
The deviceorientation Event
648(2)
The devicemotion Event
650(1)
Touch and Gesture Events
651(3)
Touch Events
651(2)
Gesture Events
653(1)
Event Reference
654(5)
Memory and Performance
659(3)
Event Delegation
659(2)
Removing Event Handlers
661(1)
Simulating Events
662(7)
DOM Event Simulation
663(5)
Simulating Mouse Events
663(1)
Simulating Keyboard Events
664(3)
Simulating Other Events
667(1)
Custom DOM Events
667(1)
Internet Explorer Event Simulation
668(1)
Summary
669(2)
Chapter 18 Animation And Graphics With Canvas 671(36)
Using requestAnimationFrame
672(4)
Early Animation Loops
672(1)
Problems with Intervals
673(1)
requestAnimationFrame
673(1)
cancelAnimationFrame
674(1)
Performance Throttling with requestAnimationFrame
674(2)
Basic Canvas Usage
676(1)
The 2D Context
677(15)
Fills and Strokes
677(1)
Drawing Rectangles
677(2)
Drawing Paths
679(2)
Drawing Text
681(2)
Transformations
683(3)
Drawing Images
686(1)
Shadows
687(1)
Gradients
687(2)
Patterns
689(1)
Working with Image Data
689(2)
Compositing
691(1)
WebGL
692(13)
The WebGL Context
693(1)
WebGL Basics
693(11)
Constants
694(1)
Method Naming
695(1)
Getting Ready to Draw
695(1)
Viewports and Coordinates
695(1)
Buffers
696(1)
Errors
697(1)
Shaders
697(4)
Drawing
701(2)
Textures
703(1)
Reading Pixels
703(1)
WebGL1 versus WebGL2
704(1)
Summary
705(2)
Chapter 19 Scripting Forms 707(36)
Form Basics
707(8)
Submitting Forms
708(1)
Resetting Forms
709(1)
Form Fields
710(5)
Common Form-Field Properties
711(2)
Common Form-Field Methods
713(1)
Common Form-Field Events
714(1)
Scripting Text Boxes
715(11)
Text Selection
716(2)
The select Event
716(1)
Retrieving Selected Text
717(1)
Partial Text Selection
717(1)
Input Filtering
718(3)
Blocking Characters
719(1)
Dealing with the Clipboard
720(1)
Automatic Tab Forward
721(2)
HTML5 Constraint Validation API
723(3)
Required Fields
723(1)
Alternate Input Types
723(1)
Numeric Ranges
724(1)
Input Patterns
724(1)
Checking Validity
725(1)
Disabling Validation
726(1)
Scripting Select Boxes
726(6)
Options Selection
728(2)
Adding Options
730(1)
Removing Options
730(1)
Moving and Reordering Options
731(1)
Form Serialization
732(2)
Rich Text Editing
734(7)
Using contenteditable
734(1)
Interacting with Rich Text
735(3)
Rich Text Selections
738(2)
Rich Text in Forms
740(1)
Summary
741(2)
Chapter 20 Javascript APIS 743(80)
Atomics and SharedArrayBuffer
744(7)
SharedArrayBuffer
744(1)
Atomics Basics
745(8)
Atomic Arithmetic and Bitwise Methods
745(2)
Atomic Reads and Writes
747(1)
Atomic Exchanges
748(1)
Atomics Futex Operations and Locks
749(2)
Cross-Context Messaging
751(2)
Encoding API
753(5)
Encoding Text
753(2)
Bulk Encoding
753(1)
Stream Encoding
754(1)
Decoding Text
755(3)
Bulk Decoding
755(1)
Stream Decoding
756(2)
Blob and File APIs
758(6)
The File Type
758(1)
The FileReader Type
759(2)
The FileReaderSync Type
761(1)
Blobs and Partial Reads
761(1)
Object URLs and Blobs
762(1)
Drag-and-Drop File Reading
763(1)
Media Elements
764(6)
Properties
765(2)
Events
767(1)
Custom Media Players
768(1)
Codec Support Detection
769(1)
The Audio Type
770(1)
Native Drag and Drop
770(5)
Drag-and-Drop Events
770(1)
Custom Drop Targets
771(1)
The dataTransfer Object
772(1)
dropEffect and effectAllowed
773(1)
Draggability
774(1)
Additional Members
774(1)
Notifications API
775(1)
Notification Permissions
775(1)
Showing and Hiding Notification
775(1)
Notification Lifecycle Callbacks
776(1)
Page Visibility API
776(1)
Streams API
777(8)
Introduction to Streams
778(1)
Chunks, Internal Queues, and Backpressure
778(1)
Readable Streams
779(2)
Using the ReadableStreamDefaultController
779(1)
Using the ReadableStreamDefaultReader
780(1)
Writable Streams
781(1)
Creating a WriteableStream
781(1)
Using a WritableStreamDefaultWriter
781(1)
Transform Streams
782(2)
Piping Streams
784(1)
Timing APIs
785(6)
High Resolution Time API
786(2)
Performance Timeline API
788(3)
User Timing API
788(1)
Navigation Timing API
789(1)
Resource Timing API
790(1)
Web Components
791(17)
HTML Templates
791(4)
Using a DocumentFragment
792(1)
Using template tags
793(1)
Template Scripts
794(1)
Shadow DOM
795(7)
Introduction to Shadow DOM
795(1)
Creating a Shadow DOM
796(1)
Using a Shadow DOM
797(2)
Composition and Shadow DOM Slots
799(2)
Event Retargeting
801(1)
Custom Elements
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)
The Web Cryptography API
808(14)
Random Number Generation
808(2)
Using the SubtleCrypto Object
810(14)
Generating Cryptographic Digests
810(2)
CryptoKeys and Algorithms
812(2)
Generating CryptoKeys
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)
Summary
822(1)
Chapter 21 Error Handling And Debugging 823(26)
Browser Error Reporting
824(1)
Desktop Consoles
824(1)
Mobile Consoles
824(1)
Error Handling
825(15)
The try-catch Statement
825(4)
The finally Clause
826(1)
Error Types
826(2)
Usage of try-catch
828(1)
Throwing Errors
829(2)
When to Throw Errors
830(1)
Throwing Errors versus try-catch
831(1)
The error Event
831(1)
Error-Handling Strategies
832(1)
Identify Where Errors Might Occur
833(5)
Static Code Analyzer
833(1)
Type Coercion Errors
833(2)
Data Type Errors
835(2)
Communication Errors
837(1)
Distinguishing between Fatal and Nonfatal Errors
838(1)
Log Errors to the Server
839(1)
Debugging Techniques
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)
Shimming Console Methods
843(1)
Throwing Errors
843(1)
Common Legacy Internet Explorer Errors
844(2)
Invalid Character
844(1)
Member Not Found
845(1)
Unknown Runtime Error
845(1)
Syntax Error
845(1)
The System Cannot Locate the Resource Specified
846(1)
Summary
846(3)
Chapter 22 XML In Javascript 849(12)
XML DOM Support in Browsers
849(3)
DOM Level 2 Core
850(1)
The DOMParser Type
850(1)
The XMLSerializer Type
851(1)
XPath Support in Browsers
852(5)
DOM Level 3 XPath
852(2)
Single Node Results
854(1)
Simple Type Results
854(1)
Default Type Results
855(1)
Namespace Support
856(1)
XSLT Support in Browsers
857(2)
The XSLTProcessor Type
857(1)
Using Parameters
858(1)
Resetting the Processor
859(1)
Summary
859(2)
Chapter 23 JSON 861(10)
Syntax
862(2)
Simple Values
862(1)
Objects
862(1)
Arrays
863(1)
Parsing and Serialization
864(6)
The JSON Object
865(1)
Serialization Options
866(3)
Filtering Results
866(1)
String Indentation
867(1)
The toJSON() Method
868(1)
Parsing Options
869(1)
Summary
870(1)
Chapter 24 Network Requests And Remote Resources 871(48)
The XMLHttpRequest Object
872(6)
XHR Usage
872(3)
HTTP Headers
875(1)
GET Requests
876(1)
POST Requests
877(1)
XMLHttpRequest Level 2
878(2)
The Form Data Type
878(1)
Timeouts
879(1)
The overrideMimeType() Method
879(1)
Progress Events
880(1)
The load Event
880(1)
The progress Event
881(1)
Cross-Origin Resource Sharing
881(3)
Preflighted Requests
883(1)
Credentialed Requests
883(1)
Alternate Cross-Domain Techniques
884(1)
Image Pings
884(1)
JSONP
884(1)
The Fetch API
885(29)
Basic API Utilization
886(7)
Dispatching a Request
886(1)
Reading a Response
886(1)
Handling Status Codes and Request Failures
887(1)
Custom Fetch Options
888(5)
Common Fetch Patterns
893(2)
Sending JSON Data
893(1)
Sending Parameters in a Request Body
893(1)
Sending Files
893(1)
Loading Files as Blobs
894(1)
Sending a Cross-Origin Request
894(1)
Aborting a Request
894(1)
The Headers Object
895(2)
Exploring Headers-Map Similarity
895(1)
Unique Features of the Headers Object
896(1)
Header Guards
896(1)
The Request Object
897(4)
Creating Request Objects
897(1)
Cloning Request Objects
898(2)
Using Request Objects with fetch()
900(1)
The Response Object
901(5)
Creating Response Objects
901(2)
Reading Response Status Information
903(2)
Cloning Response Objects
905(1)
Requests, Responses, and the Body Mixin
906(9)
Body.text()
906(1)
Body.json()
906(1)
Body.formData()
907(1)
Body.arrayBuffer()
907(1)
Body.blob()
908(1)
Single-Use Streams
908(1)
Using a ReadableStream Body
909(5)
The Beacon API
914(1)
Web Sockets
915(2)
The API
915(1)
Sending/Receiving Data
916(1)
Other Events
916(1)
Security
917(1)
Summary
918(1)
Chapter 25 Client-Side Storage 919(26)
Cookies
919(10)
Restrictions
920(1)
Cookie Parts
921(1)
Cookies in JavaScript
922(3)
Subcookies
925(3)
Cookie Considerations
928(1)
Web Storage
929(4)
The Storage Type
929(1)
The sessionStorage Object
930(2)
The localStorage Object
932(1)
The storage Event
932(1)
Limits and Restrictions
933(1)
IndexedDB
933(11)
Databases
933(1)
Object Stores
934(1)
Transactions
935(1)
Insertion
936(1)
Querying with Cursors
937(2)
Key Ranges
939(1)
Setting Cursor Direction
940(1)
Indexes
941(2)
Concurrency Issues
943(1)
Limits and Restrictions
943(1)
Summary
944(1)
Chapter 26 Modules 945(24)
Understanding the module pattern
946(4)
Module Identifiers
946(1)
Module Dependencies
946(1)
Module Loading
946(1)
Entry Points
947(1)
Asynchronous Dependencies
948(1)
Programmatic Dependencies
948(1)
Static Analysis
948(1)
Circular Dependencies
949(1)
Improvising Module Systems
950(3)
Working with pre-ES6 module loaders
953(5)
CommonJS
953(3)
Asynchronous Module Definition
956(1)
Universal Module Definition
957(1)
Module Loader Deprecation
957(1)
Working with ES6 modules
958(9)
Module Tagging and Definition
958(1)
Module Loading
959(1)
Module Behavior
959(1)
Module Exports
960(3)
Module Imports
963(2)
Module Passthrough Exports
965(1)
Worker Modules
965(1)
Backwards Compatibility
966(1)
Summary
967(2)
Chapter 27 Workers 969(66)
Introduction to Workers
970(3)
Comparing Workers and Threads
970(1)
Types of Workers
971(1)
Dedicated Web Worker
971(1)
Shared Web Worker
971(1)
Service Worker
971(1)
The WorkerGlobalScope
971(2)
WorkerGlobalScope Properties and Methods
972(1)
Subclasses of WorkerGlobalScope
972(1)
Dedicated Workers
973(24)
Dedicated Worker Basics
973(3)
Creating a Dedicated Worker
973(1)
Worker Security Restrictions
974(1)
Using the Worker Object
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)
Handling Worker Errors
983(1)
Communicating with a Dedicated Worker
983(4)
Communicating with postMessage()
983(1)
Communicating with MessageChannel
984(2)
Communicating with BroadcastChannel
986(1)
Worker Data Transfer
987(6)
Structured Clone Algorithm
987(1)
Transferable Objects
988(2)
SharedArrayBuffer
990(3)
Worker Pools
993(4)
Shared Workers
997(6)
Shared Worker Basics
997(3)
Creating a Shared Worker
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)
Service Workers
1003(30)
Service Worker Basics
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)
The Service Worker Cache
1012(1)
The CacheStorage Object
1013(1)
The Cache Object
1014(3)
Maximum Cache Storage
1017(1)
Service Worker Clients
1017(1)
Service Workers and Consistency
1018(1)
Understanding the Service Worker Lifecycle
1019(5)
The Parsed State
1020(1)
The Installing State
1020(1)
The Installed State
1021(1)
The Activating State
1022(1)
The Activated State
1023(1)
The Redundant State
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)
Service Worker Messaging
1026(2)
Intercepting a fetch Event
1028(2)
Return from Network
1028(1)
Return from Cache
1029(1)
Return from Network with Cache Fallback
1029(1)
Return from Cache with Network Fallback
1029(1)
Generic Fallback
1029(1)
Push Notifications
1030(5)
Displaying Notifications
1030(1)
Handling Notification Events
1031(1)
Subscribing to Push Events
1031(1)
Handling Push Events
1032(1)
Summary
1033(2)
Chapter 28 Best Practices 1035(32)
Maintainability
1035(12)
What Is Maintainable Code?
1036(1)
Code Conventions
1036(3)
Readability
1037(1)
Variable and Function Naming
1037(1)
Variable Type Transparency
1038(1)
Loose Coupling
1039(4)
Decouple HTMUJavaScript
1039(2)
Decouple CSS/JavaScript
1041(1)
Decouple Application Logic/Event Handlers
1041(2)
Programming Practices
1043(4)
Respect Object Ownership
1043(1)
Avoid Globals
1044(1)
Avoid Null Comparisons
1045(1)
Use Constants
1046(1)
Performance
1047(12)
Be Scope-Aware
1047(2)
Avoid Global Lookups
1047(1)
Avoid the with Statement
1048(1)
Choose the Right Approach
1049(5)
Avoid Unnecessary Property Lookup
1049(1)
Optimize Loops
1050(1)
Unrolling Loops
1051(2)
Avoid Double Interpretation
1053(1)
Other Performance Considerations
1054(1)
Minimize Statement Count
1054(2)
Multiple Variable Declarations
1054(1)
Insert Iterative Values
1055(1)
Use Array and Object Literals
1055(1)
Optimize DOM Interactions
1056(3)
Minimize Live Updates
1056(1)
Use innerHTML
1057(1)
Use Event Delegation
1058(1)
Beware of HTMLCollections
1058(1)
Deployment
1059(5)
Build Process
1059(2)
File Structure
1060(1)
Task Runners
1060(1)
Tree Shaking
1060(1)
Module Bundlers
1061(1)
Validation
1061(1)
Compression
1062(2)
Code Minification
1062(1)
JavaScript Compilation
1063(1)
JavaScript Transpilation
1063(1)
HTTP Compression
1064(1)
Summary
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
Matt Frisbie is the author of Angular 2 Cookbook and AngularJS Web Application Development Cookbook as well as several video series. A software engineer at Google, he is actively involved in the JavaScript community and often does open webcasts as well as giving talks at meetups.