Forum Moderators: open
<Script language = JavaScript>
alert("Sorry, this page is under construction")
window.history.back()
</Script>
That script could go in say page2.html. On page1.html, there might be a link leading to page2.html. When the link is clicked, the above script will be executed in page2.html. The results is that first the alert box displays. Then the second line of code gets executed. This uses the back() method of the history object to take the user back to where they came from. The forward() method the same way, except your user will be taken forward one page in the browsing history.
To use the go() method of the history object, just type a number in between those two brackets. Like this:
window.history.go( -2 )
The minus two means back two pages. To go forward, just remove the minus sign (-).