Ken Ward's Java Script Tutorial ...

Back and Forward Buttons using History

This page is the first in a series addressing navigation. It uses history to navigate from one page to another. Other page in this series are:

Back and Forward Buttons (Simple)
Back and Forward Buttons
Back and Forward Buttons 2

The following form buttons go to the next or previous page in history, as appropriate. They act just like the back and forward buttons on the browser. I don't see much use for them but sometimes the user might prefer to use the page to navigate than to use the browser. It seems more professional to do this!

I don't see much use for them because they just duplicate the browser's button. And it is better to send the reader to a specific page than to sent him or her back in history. Sometimes, they are appropriate, however.


Here is the code for the form:

<INPUT TYPE="button" VALUE="<< Back" onClick="Back1()">
button" VALUE="Forward >>" onClick="Forward1()">

Here is the script:

<script LANGUAGE="JavaScript">

The script uses the simple 'history.go()' with values for +1 (forward) and -1 (backwards).


Ken Ward's HTML Guide...

[If you need to learn more about HTML visit the HTML Tutorial]

To ask questions, make comments, etc,