History.go()

JavaScript 1.0+, ECMAScript 1.0+, JScript 1.0+ Nav2+, IE 3+, Opera3+ Syntax

history.go(num)

Description

The go() method of the History object loads a URL from the history list.

Example

Listing 7.297 shows how the go() method can be used to navigate to another Web site in the history list.

Listing 7.297 Example of the History go() Method
<html>
<head>
<title> Using the go method of the History object</title>
</head>
<body>

<form name=form1>
Click on the button to go back 2 pages.
<input type="button" value="Go" onClick='window.history.go(-2)'>
</form>

</body>
</html>
							
						

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.