Skip to content

Lesson 05 · The DOM

Browser Storage & Network Requests

Persist data on the device with localStorage and IndexedDB, and load data over the network with fetch, promises and async/await - rendering loading, error and empty states honestly.

45 minintermediateThe DOM & Browser APIs

Prerequisites: Forms & Validation in the Browser

Learning objectives
By the end of this lesson, you will be able to:
  • Persist and reload small data with localStorage and JSON.stringify/parse
  • Choose between localStorage, sessionStorage and IndexedDB by size and shape
  • Read promise-based APIs with then/catch and async/await plus try/catch
  • Fetch JSON, check response.ok before trusting it, and send POST requests with headers and a body
  • Render loading, error and empty states instead of pretending nothing can fail