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

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?

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:

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage · Working with Ajax Server Extensions
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Wi-Fi Product Watch, November 2009 · Chip Market Recovering From '08 Collapse · Low-Cost Tools to Kickstart Your New Business