The History Object
The history object represents the user's navigation history. The history object is a property of window. Each browser window, tab, and frame has its own history object.
It's not possible to determine the visted URLs. It is possible to navigate backwards and forwards.
The following table lists the properties and methods in history object.
Name | Description | Returns |
---|---|---|
back() | Goes one step back. | void |
forward() | Goes one step forward. | void |
go(<index>) | Goes to a position relative to the current document. Positive values are forward, negative are backward. | void |
length | Returns the number of items in the history. | number |
pushState(<state>, <title>, <url>) | Adds an entry to the browser history. | void |
replaceState(<state>, <title>, <url>) | Replaces the current entry in the browser history. | void |
state | Returns the state data associated with the current document in the browser history. | object |