Section 25.140. History: the URL history of the browser


25.140. History: the URL history of the browser

JavaScript 1.0: Object History

25.140.1. Synopsis

 window.history history 

25.140.2. Properties


length

This numeric property specifies the number of URLs in the browser's history list. Since there is no way to determine the index of the currently displayed document within this list, knowing the size of this list is not particularly helpful.

25.140.3. Methods


back( )

Goes backward to a previously visited URL.


forward( )

Goes forward to a previously visited URL.


go( )

Goes to a previously visited URL.

25.140.4. Description

The History object was originally designed to represent the browsing history of a window. For privacy reasons, however, the History object no longer allows scripted access to the actual URLs that have been visited. The only functionality that remains is in the use of the back( ), forward( ), and go( ) methods.

25.140.5. Example

The following line performs the same action as clicking a browser's Back button:

 history.back( ); 

The following line performs the same action as clicking the Back button twice:

 history.go(-2); 

25.140.6. See Also

The history property of the Window object, Location




JavaScript. The Definitive Guide
JavaScript: The Definitive Guide
ISBN: 0596101996
EAN: 2147483647
Year: 2004
Pages: 767

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net