spacer
Yehuda Shiran November 17, 1999
Browsing the History List
Tips: November 1999

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
Eclipse Helios Update Brings New PHP Tools
Internet Explorer 9 Ups Standards Support
JBoss Portal 5 Release Easier to Use

The history.go() method loads a URL from the browser's history list:

history.go(vLocation);

The method receives one argument, specifying the relative position of the desired URL in the history list. For example, the following statement is equivalent to the browser's Back button:

history.go(-1);

Note that an error does not occur if the user tries to go beyond the beginning or end of the history. Instead, the user remains at the current page. Alternatively, you can specify one of the URLs or document titles stored in the browser's history list. The method compares the string against all listings. The first item in the history list to contain the parameter string will be regarded as the match. But, again, no navigation takes place if the item you specify is not listed in the history.

The history object also features to specific methods that are equivalent to history.go(-1) and history.go(1):

history.back();
history.forward();


People who read this tip also read these tips:

Look for similar tips by subject:

webref The latest from WebReference.com Browse >
Flashmaps' DynamicLocator: Interactive Maps for Small Areas · Flashmaps' AreaSelector: Interactive Maps for Wide Areas · The DB Mapper: Interactive Street-level Maps of U.S. and Canada
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
MS Access and MySQL · Cisco AutoQoS: VoIP QoS for Mere Mortals · While VoIP Adoption Explodes in Enterprise, Carrier Spending Lags