/*
  Dynamic Code to accompany CS3172 dual presention redux example (based on an example by David Kolb)

  June 2005 (Note added October 2008)

  ECMAScript / JScript

  File: goback.js

  See also: shrink.js file
*/
document.writeln ('<div id="DivBack" class="navbox">');
document.writeln (' <p id="ParBack">');
document.writeln (' <a ');
document.writeln (' onclick="javascript:history.back(); return false"');
document.writeln (' onkeypress="javascript:history.back(); return false"');
document.writeln (' >Return to<br />previous</a>');
document.writeln (' </p>');
document.writeln ('</div>');
/* End of File */

Note about return false

Quoted from þp]{

Many events have an associated default action, For instance, clicking on a link means that the browser should load the page the link points to. Submitting a form means the browser should send the form to the server. Pressing a key means the browser should add the character to the text field the user is working on.

The general rule is the the event handler is executed first, and the default action takes place afterwards. This allows the event handler to cancel the default action.

The return value of an event-handling function serves to allow or disallow the default action. If the funtion returns false, then the default action is cancelled. Any other return value will cause the default action to take place.

Source

ppk on JavaScript
pp. 296–297 (Chapter 7:Events, Section B: The Events)
by Peter-Paul Koch
©2007 by Peter-Paul Koch
Published by New Riders, an imprint of Peachpit, a division of Pearson education