We present below a short history of Ajax: an introduction to XMLHttpRequest level 2 (XHR2).
Wikipedia definition: "Ajax, short for Asynchronous JavaScript and XML), is a group of interrelated Web development techniques used on the client-side to create asynchronous Web applications. With Ajax, Web applications can send data to and retrieve from a server asynchronously (in the background) without interfering with the display and behavior of the existing page. Data can be retrieved using the XMLHttpRequest object. Despite the name, the use of XML is not required (JSON is often used), and the requests do not need to be asynchronous."
Ajax appeared around 2005 with Google Maps, and is now widely used. We are not going to teach you Ajax programming, but instead focus on the relationships between "the new version of Ajax", known as XHR2 (for XmlHttpRequest level 2) and the File API (seen in the W3Cx HTML5 Coding Essentials and Best Practices MOOC). Also, you will discover that the HTML5 <progress> element is of great use for monitoring the progress of file uploads (or downloads).
We recommend reading this article from HTML5Rocks.com that presents the main features of XHR2.
Briefly, these improvements include:
New, easier to use syntax,
In-browser encoding/decoding of binary files,
Progress monitoring of uploads and downloads.
The following sections of this course present a few examples of file downloads/uploads together with the file API and show how to monitor progress.
The current support of XHR2 is excellent: see related CanIUse's browser compatibility table.