Examples by Chapter

Each recipe in the book has a corresponding example. When possible, the book code has additional code added to make it a fully functioning demo. The code from the book, with minimal modifications, will appear at the top of the example's JavaScript code.

When running the demos, check the browser console for additional logging output.

Chapter 1
Asynchronous APIs

Explore fundamental asynchronous JavaScript concepts, including callback functions and Promises.

Chapter 2
Simple Persistence with the Web Storage API

Store and retrieve data using persistent storage.

Chapter 3
URLs and Routing

Work with the URL and History APIs.

Chapter 4
Network Requests

Communicate with remote servers and APIs.

Chapter 5

A more sophisticated data store which can store collections of objects.

Chapter 6
Observing the DOM

Listen for changes to DOM elements and their structure.

Chapter 7

Enhance your forms with the FormData and Constraint Validation APIs.

Chapter 8
The Web Animations API

Apply keyframe animations to elements programmatically.

Chapter 9
The Web Speech API

Add voice synthesis and recognition to your apps.

Chapter 10
Working With Files

Read and write file data.

Chapter 11

Explore the internationalization APIs built in to the browser.

Chapter 12
Web Components

Create custom HTML elements.

Chapter 13
UI Elements

Use dialogs and other interactive elements.

Chapter 14
Device Integration

Interact with sensors and services on your device.

Chapter 15
Measuring Performance

Capture performance metrics.

Chapter 16
Working With the Console

Learn about different ways to present information using the Console API.

Chapter 17

Explore CSS related APIs.

Chapter 18

Work with images and video.

Web API Cookbook
Joe Attardi