Name

PopStateEvent — history transition event

Inherits from

Event

Synopsis

Web applications that manage their own history (see History Management) use the pushState() method of History to create a new entry in the browsing history and associate a state value or object with it. When the user uses the browser’s Back or Forward buttons to navigate between those saved states, the browser triggers a popstate event on the Window object and passes a copy of the saved application state in the associated PopStateEvent object.

Properties

readonly any state

This property holds a copy of the state value or object that was passed to the History. pushState() or History.replaceState() method. The state can be any value that can be cloned with the structured clone algorithm (see Structured Clones).

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.