9. Changing Browser History

This chapter discusses updates to the history interface in HTML5, specifically with two new methods in the History API (pushState and replaceState), and includes several recipes for incorporating them into your session navigation. In addition, you will learn about the state event, using the History API to store more than just page navigation, and advanced topics such as security and extended libraries.

History Basics

The History API, a JavaScript API, has been used in sites since JavaScript 1.0 and has not been updated significantly until HTML5. With the advent of Ajax and pageless navigation, the use of the history object to go forward, to go backward, or to go to a specific session entry became problematic. In fact, ...

Get HTML5 Developer’s Cookbook 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.