PopStateEvent object
Fires when a history entry changes.
![]() |
Syntax
window.onpopstate = function(evt) { document.write("location: " + document.location + ", state: " + JSON.stringify(evt.state)); };
DOM Information
Inheritance Hierarchy
Event
PopStateEvent
Members
The PopStateEvent object has these types of members:
Methods
The PopStateEvent object has these methods.
| Method | Description |
|---|---|
| initPopStateEvent |
Initializes the properties of a PopStateEvent. |
Properties
The PopStateEvent object has these properties.
| Property | Access type | Description |
|---|---|---|
|
Read-only |
Returns the information that was provided to pushState or replaceState. |
Remarks
A pop state event is dispatched to the window object every time the active history entry changes.
To read the current history entry immediately, invoke history.state.
See also
Show:
