Web developmentLesson 3 of 4 in the course JavaScript and the browser

Ajax Requests: Asynchronous Updates, XMLHttpRequest, and Fetch

5 flashcards · 5 quiz questions · 5 match pairs · 5 fill-in sentences · English

Lesson progress
0 / 5

Your progress is kept in this browser only.Sign up to save it

Summary

Ajax lets a web page communicate with a server in the background and update part of its content without reloading the entire page. This lesson introduces Ajax as a programming pattern, explains the technologies commonly involved, and traces its development.

Ajax, short for Asynchronous JavaScript and XML, is a set of web development techniques for exchanging data with a server asynchronously. “Asynchronously” means the browser can continue to display and respond to the current page while a request is happening in the background.

All flashcards

What does Ajax describe?
A programming pattern for background client-server communication that can update page content without a full-page reload.
What does XMLHttpRequest provide?
A browser API for making asynchronous HTTP requests; it can exchange formats other than XML.
What does the Fetch function return?
A Promise representing a result that may become available later.
How can JavaScript update a page after receiving an Ajax response?
It can use the DOM to change the relevant page content.
What does Fetch's response.ok property indicate?
Whether the HTTP status is in the 200–299 range.

Quiz questions

  1. Why is Ajax a programming pattern rather than a single technology?Answer: It combines web technologies and techniques for background communication and dynamic page updates.
  2. Which sequence best describes a typical Ajax interaction?Answer: JavaScript sends a request, receives a response, processes it, and updates relevant page content.
  3. Which statement about XMLHttpRequest is correct?Answer: It can exchange JSON, text, HTML, or XML with a server.
  4. What is one benefit of asynchronous requests during a page interaction?Answer: The browser can keep the current interface displayed while the request is in progress.
  5. Which technology is another browser-side option for making background requests besides XMLHttpRequest?Answer: The JavaScript Fetch function.

Based on the Wikipedia article Ajax (programming), licensed CC BY-SA 4.0. Adapted into a summary, flashcards and quizzes.

All Web development lessons