Chapter 22. HTML5 APIs

The term HTML5 refers to the latest version of the HTML specification, of course, but it has also come to refer to an entire suite of web application technologies that are being developed and specified as part of or alongside HTML. A more formal term for these technologies is the Open Web Platform. In practice, however, “HTML5” is a convenient shorthand, and this chapter uses it in that way. Some of the new HTML5 APIs are documented elsewhere in this book:

  • Chapter 15 covers the getElementsByClassName() and querySelectorAll() methods and the dataset attribute of document elements.

  • Chapter 16 covers the classList property of elements.

  • Chapter 18 covers XMLHttpRequest Level 2, cross-origin HTTP requests, and the EventSource API defined by the Server-Sent Events specification.

  • Chapter 20 documents the Web Storage API and the application cache for offline web apps.

  • Chapter 21 covers the <audio>, <video>, and <canvas> elements and SVG graphics.

This chapter covers a number of other HTML5 APIs:

  • Geolocation covers the Geolocation API, which allows browsers to (with permission) determine the user’s physical location.

  • History Management covers history management APIs that allow web applications to save and update their state in response to the browser’s Back and Forward buttons without having to reload themselves from the web server.

  • Cross-Origin Messaging describes a simple API for passing messages between documents with different origins. This API safely works around the same-origin ...

Get JavaScript: The Definitive Guide, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.