AJAX

Talking to a server without reloading the page.

AJAX is taught here in 12 lessons, running from Requests with fetch through to Debugging network problems. Each lesson takes one topic, shows the working code, and links onward to the next, so the course can be read straight through in order.

TrackFront-end Development
Lessons12
LevelBeginner to intermediate
Reading timeabout 3 hours
PrerequisitesHelpful, but not required: HTML DOM

Lessons

  1. Requests with fetchMake a request without reloading the page, read the response correctly, send data, and stop a slow request with AbortController.
  2. Bodies, headers and status codesWhich headers you control, how to read the response body, and how to branch on status codes without duplicating error handling everywhere.
  3. XMLHttpRequest and the gaps in fetchThe original transport API, upload progress with xhr.upload, and an honest comparison of when XMLHttpRequest is still the right tool.
  4. Async patterns for real request flowsChoose the right combinator for parallel work, cap concurrency, retry safely with backoff, and stop duplicate calls before they leave the browser.
  5. Same-origin policy, CORS and credentialsWhat the browser blocks and what it merely hides, how simple requests differ from preflighted ones, and what changes when cookies are involved.
  6. Authentication, tokens and CSRFBearer tokens against cookie sessions, a refresh flow that does not stampede, and the request-forgery defences that go with each storage choice.
  7. Parsing, validating and modelling responsesHandle the envelope shapes APIs return, check data at the boundary before it reaches your UI, and map wire formats into the models your app uses.
  8. Caching and conditional requestsUse freshness and validators so repeat requests cost nothing, and build a small client cache that also collapses duplicate in-flight calls.
  9. Uploading files and multipart formsBuild a multipart body from files and fields, report progress honestly, validate before the bytes leave the browser, and know what resumable means.
  10. Streaming and long-lived connectionsRead a response body chunk by chunk, parse newline-delimited JSON, and use Server-Sent Events for a one-way feed that reconnects itself.
  11. Building an API client layerPut the base URL, error types, auth refresh and test seams in one module, so no component ever calls fetch directly.
  12. Debugging network problemsRead the Network panel properly, decode a CORS failure, capture a HAR file, and tell a timeout from an abort from a network failure.

More in Front-end Development

HTML CSS JavaScript TypeScript HTML DOM JSON Tailwind CSS Bootstrap 5 Foundation Vue.js React Next.js Angular jQuery ECharts Chart.js SVG Font Awesome

FAQ

How long does the AJAX course take?
It has 12 lessons, about 3 hours of reading. Expect roughly twice that if you type out and run every example.
Do I need prior experience for AJAX?
Not strictly. It helps to have read HTML DOM first, because some lessons build on it, but every lesson explains its own assumptions.
What should I read after AJAX?
Continue with JSON (3 lessons), the next course in Front-end Development.

Last refreshed 2026-09-18.