(page requirements)

Back and forward

Sure you can ask your visitors to use their brower's BACK and FORWARD buttons to navigate your site. Wouldn't it be nice to have your own BACK and FORWARD buttons on your pages as in the following example:
 
 
All you have to do is place the following HTML tags on your page:
 
<FORM METHOD="post">

<INPUT TYPE="button" 
      VALUE="BACK" 
    OnClick="history.go( -1 );return true;">

<INPUT TYPE="button" 
      VALUE="FORWARD" 
    OnClick="history.go(  1 );return true;">

</FORM>
Listing #1 : HTML code. Download backforw (0.25 KB).
 
As you can see, we're simply using JavaScript's "history object" to go back and forward.
 
If you prefer hyperlinks to buttons, use following tags instead:
 
<A HREF="javascript:history.go(-1)">
Go back
</A>

<A HREF="javascript:history.go(1)">
Go forward
</A>
Listing #2 : HTML code. Download bakfwda (0.2 KB).
 
Result:
 
[ Go back | Go forward ]
 
 
Applicable Keywords : HTML, Internet Explorer, Explorer 3.x, Explorer 4.x, Explorer 5.x, Internet, JavaScript, JavaScript 1.0, JavaScript 1.1, JavaScript 1.2, Netscape Navigator, Navigator 2.x, Navigator 3.x, Communicator 4.x, Netscape 6.x, World Wide Web
 
 
 
Copyright © 2009 Chami.com. All Rights Reserved. | Advertise | Created in HTML Kit editor