15.1 Web Programming Basics15.1.1 JavaScript in HTML <script> Tags15.1.2 The Document Object Model15.1.3 The Global Object in Web Browsers15.1.4 Scripts Share a Namespace15.1.5 Execution of JavaScript Programs15.1.6 Program Input and Output15.1.7 Program Errors15.1.8 The Web Security Model15.2 Events15.2.1 Event Categories15.2.2 Registering Event Handlers15.2.3 Event Handler Invocation15.2.4 Event Propagation15.2.5 Event Cancellation15.2.6 Dispatching Custom Events15.3 Scripting Documents15.3.1 Selecting Document Elements15.3.2 Document Structure and Traversal15.3.3 Attributes15.3.4 Element Content15.3.5 Creating, Inserting, and Deleting Nodes15.3.6 Example: Generating a Table of Contents15.4 Scripting CSS15.4.1 CSS Classes15.4.2 Inline Styles15.4.3 Computed Styles15.4.4 Scripting Stylesheets15.4.5 CSS Animations and Events15.5 Document Geometry and Scrolling15.5.1 Document Coordinates and Viewport Coordinates15.5.2 Querying the Geometry of an Element15.5.3 Determining the Element at a Point15.5.4 Scrolling15.5.5 Viewport Size, Content Size, and Scroll Position15.6 Web Components15.6.1 Using Web Components15.6.2 HTML Templates15.6.3 Custom Elements15.6.4 Shadow DOM15.6.5 Example: a <search-box> Web Component15.7 SVG: Scalable Vector Graphics15.7.1 SVG in HTML15.7.2 Scripting SVG15.7.3 Creating SVG Images with JavaScript15.8 Graphics in a <canvas>15.8.1 Paths and Polygons15.8.2 Canvas Dimensions and Coordinates15.8.3 Graphics Attributes15.8.4 Canvas Drawing Operations15.8.5 Coordinate System Transforms15.8.6 Clipping15.8.7 Pixel Manipulation15.9 Audio APIs15.9.1 The Audio() Constructor15.9.2 The WebAudio API15.10 Location, Navigation, and History15.10.1 Loading New Documents15.10.2 Browsing History15.10.3 History Management with hashchange Events15.10.4 History Management with pushState()15.11 Networking15.11.1 fetch()15.11.2 Server-Sent Events15.11.3 WebSockets15.12 Storage15.12.1 localStorage and sessionStorage15.12.2 Cookies15.12.3 IndexedDB15.13 Worker Threads and Messaging15.13.1 Worker Objects15.13.2 The Global Object in Workers15.13.3 Importing Code into a Worker15.13.4 Worker Execution Model15.13.5 postMessage(), MessagePorts, and MessageChannels15.13.6 Cross-Origin Messaging with postMessage()15.14 Example: The Mandelbrot Set15.15 Summary and Suggestions for Further Reading15.15.1 HTML and CSS15.15.2 Performance15.15.3 Security15.15.4 WebAssembly15.15.5 More Document and Window Features15.15.6 Events15.15.7 Progressive Web Apps and Service Workers15.15.8 Mobile Device APIs15.15.9 Binary APIs15.15.10 Media APIs15.15.11 Cryptography and Related APIs