Availability
JavaScript 1.0; enhanced in JavaScript 1.1
Synopsis
history.go(relative_position)history.go(target_string)
Arguments
relative_position
The relative position in the History list of the URL to be visited.
In IE 3, this argument must be 1, 0, or -1.
target_string
A substring of the URL to be visited. This version of the
go( ) method was added in JavaScript 1.1.
Description
The first form of the History.go( ) method takes
an integer argument and causes the browser to visit the URL that is
the specified number of positions distant in the history list
maintained by the History object. Positive arguments move the browser
forward through the list, and negative arguments move it backward.
Thus, calling history.go(-1) is equivalent to
calling history.back( ) and produces the same
effect as clicking on the Back
button. Similarly, history.go(3) revisits the same
URL that would be visited by calling history.forward(
) three times. Calling go( ) with an
argument of 0 causes the current page to be reloaded (although in
Netscape 3, the Location.reload( ) provides a
better way of doing this). This form of the method is buggy in
multiframe documents in Netscape 3, and in Internet Explorer it can
be called only with the values 1, 0, and -1.
The second form of the History.go( ) method was
implemented in JavaScript 1.1. It takes a string argument and causes
the browser to revisit the first (i.e., most recently visited) URL
that contains the specified string.
•
Table of Contents
•
Index
•
Reviews
•
Examples
•
Reader Reviews
•
Errata
JavaScript: The Definitive Guide, 4th Edition
By
David Flanagan
Publisher
: O'Reilly
Pub Date
: November 2001
ISBN
: 0-596-00048-0
Pages
: 936
Slots
: 1
This fourth edition of the definitive reference to
JavaScript, a scripting language that can be embedded
directly in web pages, covers the latest version of the
language, JavaScript 1.5, as supported by Netscape 6 and
Internet Explorer 6. The book also provides complete
coverage of the W3C DOM standard (Level 1 and Level 2),
while retaining material on the legacy Level 0 DOM for
backward compatibility.