history object
Contains information about the URLs visited by the client.
Members
The history object has these types of members:
Methods
The history object has these methods.
| Method | Description |
|---|---|
| back |
Loads a previous URL from the History list. |
| forward |
Loads the next URL from the History list. |
| go |
Loads a URL from the History list. |
| pushState |
Pushes the given data with the given title, and the given URL, if provided, onto the session history . |
| replaceState |
Updates the current entry in the session history to have the given data, title, and, if provided, URL. |
Properties
The history object has these properties.
| Property | Access type | Description |
|---|---|---|
|
Retrieves the number of elements in the History list. | ||
|
Read-only |
Returns the current state object. |
Standards information
There are no standards that apply here.
Remarks
For security reasons, the history object does not expose the actual URLs in the browser history. It does allow navigation through the browser history by exposing the back, forward, and go methods. A particular document in the browser history can be identified as an index relative to the current page. For example, specifying -1 as a parameter for the go method is the equivalent of clicking the Back button.