go method (history)
Loads a page from the history list into the current window.
Syntax:
You can find the related objects in the Supported by objects section below.
Parameters:
Required. Integer that specifies the relative position of a URL in the history list. For example go(-1) is equivalent to the back method, go(1) is equivalent to the forward method. This parameter can also be a string in Internet Explorer. In that case it specifies the exact URL of a document in the history list. |
Return value:
This method has no return value.
Example HTML code 1:
This example illustrates the use of the go method.
|
||||
<head> <script type="text/javascript"> function GoBack () { history.go (-1); } function GoForward () { history.go (1); } </script> </head> <body> Click on the following anchors first to add items to the history list. <br /> <a href="#target1">First anchor</a> <a name="target1"></a> <br /> <a href="#target2">Second anchor</a> <a name="target2"></a> <br /><br /> Use these buttons to navigate in the history list: <button onclick="GoBack ();">go back in the history list</button> <button onclick="GoForward ();">go forward in the history list</button> </body> |
||||
|
||||
Did you find this example helpful?
|
Supported by objects:
Related pages:
External links:
User Contributed Comments