window.forward()

JavaScript1.2+, Jscript3.0 Nav4+, IE4+ Syntax

							window.forward()

Description

The forward() method of the Window object simulates the user clicking the Forward button on the browser. It returns the browser's page or frame to the next page or frame in its history.

Example

Listing 7.540 has two buttons. One of the buttons takes the browser back one page and the other button takes it forward. Note that there has to be a back and previous page during your session for the button to have somewhere to go.

Listing 7.540 Using the forward() Method to Take the User to the Next Page in Their History
 <html> <body> <form> <input type=BUTTON value="Back" onClick="window.back()"> <input type=BUTTON value="Forward" onClick="window.forward()"> ...

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.