Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
The following HTML code adds a command button to a Web page form:
HTML Code That Uses VBScript:
<FORM method="POST" name="VBScript_Nav_Sample">
<INPUT TYPE="button" NAME="Go Back!"
VALUE="VBScript_Backup_Sample" LANGUAGE="VBScript"
OnClick="call window.history.back(1)">
</FORM>
HTML Code That Uses JavaScript:
<FORM>
<input type="button" value="Button" name="B3" onClick="javascript:history.back(1)">
</FORM>
The following HTML code adds a hyperlink that retraces the Web
browser's history:
<a href="JavaScript:history.back(1)">the past</a>
NOTE: Netscape Navigator versions 4.5 and earlier require all form elements to be contained within form tags. If you are certain your browsing audience will be using Internet Explorer, you may omit the form tags from the sample above.
Netscape Navigator 2.0 and Internet Explorer 3.0 and all more recent versions of those browsers support the onClick method of the button input type.
The third-party products that are discussed in this article are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, regarding the performance or reliability of these products.