155 lines
2.7 KiB
Markdown
155 lines
2.7 KiB
Markdown
|
# Chapter 15. JavaScript in Web Browsers
|
||
|
|
||
|
## 15.1 Web Programming Basics
|
||
|
|
||
|
### 15.1.1 JavaScript in HTML <script> Tags
|
||
|
|
||
|
### 15.1.2 The Document Object Model
|
||
|
|
||
|
### 15.1.3 The Global Object in Web Browsers
|
||
|
|
||
|
### 15.1.4 Scripts Share a Namespace
|
||
|
|
||
|
### 15.1.5 Execution of JavaScript Programs
|
||
|
|
||
|
### 15.1.6 Program Input and Output
|
||
|
|
||
|
### 15.1.7 Program Errors
|
||
|
|
||
|
### 15.1.8 The Web Security Model
|
||
|
|
||
|
## 15.2 Events
|
||
|
|
||
|
### 15.2.1 Event Categories
|
||
|
|
||
|
### 15.2.2 Registering Event Handlers
|
||
|
|
||
|
### 15.2.3 Event Handler Invocation
|
||
|
|
||
|
### 15.2.4 Event Propagation
|
||
|
|
||
|
### 15.2.5 Event Cancellation
|
||
|
|
||
|
### 15.2.6 Dispatching Custom Events
|
||
|
|
||
|
## 15.3 Scripting Documents
|
||
|
|
||
|
### 15.3.1 Selecting Document Elements
|
||
|
|
||
|
### 15.3.2 Document Structure and Traversal
|
||
|
|
||
|
### 15.3.3 Attributes
|
||
|
|
||
|
### 15.3.4 Element Content
|
||
|
|
||
|
### 15.3.5 Creating, Inserting, and Deleting Nodes
|
||
|
|
||
|
### 15.3.6 Example: Generating a Table of Contents
|
||
|
|
||
|
## 15.4 Scripting CSS
|
||
|
|
||
|
### 15.4.1 CSS Classes
|
||
|
|
||
|
### 15.4.2 Inline Styles
|
||
|
|
||
|
### 15.4.3 Computed Styles
|
||
|
|
||
|
### 15.4.4 Scripting Stylesheets
|
||
|
|
||
|
### 15.4.5 CSS Animations and Events
|
||
|
|
||
|
## 15.5 Document Geometry and Scrolling
|
||
|
|
||
|
### 15.5.1 Document Coordinates and Viewport Coordinates
|
||
|
|
||
|
### 15.5.2 Querying the Geometry of an Element
|
||
|
|
||
|
### 15.5.3 Determining the Element at a Point
|
||
|
|
||
|
### 15.5.4 Scrolling
|
||
|
|
||
|
### 15.5.5 Viewport Size, Content Size, and Scroll Position
|
||
|
|
||
|
## 15.6 Web Components
|
||
|
|
||
|
### 15.6.1 Using Web Components
|
||
|
|
||
|
### 15.6.2 HTML Templates
|
||
|
|
||
|
### 15.6.3 Custom Elements
|
||
|
|
||
|
### 15.6.4 Shadow DOM
|
||
|
|
||
|
### 15.6.5 Example: a <search-box> Web Component
|
||
|
|
||
|
## 15.7 SVG: Scalable Vector Graphics
|
||
|
|
||
|
### 15.7.1 SVG in HTML
|
||
|
|
||
|
### 15.7.2 Scripting SVG
|
||
|
|
||
|
### 15.7.3 Creating SVG Images with JavaScript
|
||
|
|
||
|
## 15.8 Graphics in a <canvas>
|
||
|
|
||
|
### 15.8.1 Paths and Polygons
|
||
|
|
||
|
### 15.8.2 Canvas Dimensions and Coordinates
|
||
|
|
||
|
### 15.8.3 Graphics Attributes
|
||
|
|
||
|
### 15.8.4 Canvas Drawing Operations
|
||
|
|
||
|
### 15.8.5 Coordinate System Transforms
|
||
|
|
||
|
### 15.8.6 Clipping
|
||
|
|
||
|
### 15.8.7 Pixel Manipulation
|
||
|
|
||
|
## 15.9 Audio APIs
|
||
|
|
||
|
### 15.9.1 The Audio() Constructor
|
||
|
|
||
|
### 15.9.2 The WebAudio API
|
||
|
|
||
|
## 15.10 Location, Navigation, and History
|
||
|
|
||
|
### 15.10.1 Loading New Documents
|
||
|
|
||
|
### 15.10.2 Browsing History
|
||
|
|
||
|
### 15.10.3 History Management with hashchange Events
|
||
|
|
||
|
### 15.10.4 History Management with pushState()
|
||
|
|
||
|
## 15.11 Networking
|
||
|
|
||
|
### 15.11.1 fetch()
|
||
|
|
||
|
### 15.11.2 Server-Sent Events
|
||
|
|
||
|
### 15.11.3 WebSockets
|
||
|
|
||
|
## 15.12 Storage
|
||
|
|
||
|
### 15.12.1 localStorage and sessionStorage
|
||
|
|
||
|
### 15.12.2 Cookies
|
||
|
|
||
|
### 15.12.3 IndexedDB
|
||
|
|
||
|
## 15.13 Worker Threads and Messaging
|
||
|
|
||
|
### 15.13.1 Worker Objects
|
||
|
|
||
|
### 15.13.2 The Global Object in Workers
|
||
|
|
||
|
### 15.13.3 Importing Code into a Worker
|
||
|
|
||
|
### 15.13.4 Worker Execution Model
|
||
|
|
||
|
### 15.13.5 postMessage(), MessagePorts, and MessageChannels
|
||
|
|
||
|
### 15.13.6 Cross-Origin Messaging with postMessage()
|
||
|
|
||
|
## 15.14 Example: The Mandelbrot Set
|