History Object
The History object is a predefined object which can be accessed through the
history property of the Window object.
The History object consists of an array of URLs. These URLs are the URLs the
user has visited within a browser window.
Note: The History object is not a W3C standard.
The History object's properties and methods are
described below:
N: Netscape (including Mozilla when N6 or higher), IE: Internet Explorer, W3C: World Wide Web Consortium (Internet Standard)
Properties
Syntax: history.property_name
Property |
Description |
N |
IE |
W3C |
length |
Returns the number of elements in the history list |
2 |
3 |
No |
Methods
Syntax: history.method_name()
Method |
Description |
N |
IE |
W3C |
back() |
Loads the previous URL in the history list (same as
clicking the Back button and to history.go(-1)) |
2 |
3 |
No |
forward() |
Loads the next URL in the history list
(same as clicking the Forward button and to history.go(1)) |
2 |
3 |
No |
go(number|"URL") |
Loads a specified URL from the history list |
2 |
3 |
No |
|