OBJECT:
History
The
History object is a predefined JavaScript object which is accessible
through the history property of a window object. The window.history
property is an array of URL strings which reflect the entries in the History
object. The History object consists of an array of URLs, accessible
through the browser's Go menu, which the client has visited within a window.
It is possible to change a window's current URL without an entry being
made in the History object by using the location.replace
method.
PROPERTIES
current Property
The current property contains the complete URL of the current
History entry.
Syntax: history.current
length Property
The length property contains the number of elements in the History
list.
Syntax: history.length
next Property
The next property contains the complete URL of the next element
in the History list, and is the equivalent of the URL the user
would go to if they selected Forward in the Go menu.
Syntax: history.next
previous Property
The previous property contains the complete URL of the previous
element in the History list, and is the equivalent of the URL
the user would go to if they selected Back in the Go menu.
Syntax: history.previous
METHODS
back Method
The back method loads the previous URL in the History
list, and is equivalent to the browser's Back button and to history.go(-1).
Syntax: history.back()
forward Method
The forward method loads the next URL in the History list,
and is equivalent to the browser's Forward button and to history.go(1).
Syntax: history.forward()
go Method
The go method loads a specified URL from the History list.
Syntax: history.go(delta)
history.go(location)
|