Spectacular Free Slide Show MP3 Sound Streamer Email Link Encoder Stream Website Audio Cool Free Text Scroller

CodeLifter.com
Software & Scripts by CodeBrain.com
Home

JavaScripts
PopUp Maker
-
popup windows

CodeLifter 5
-
source viewer

ScrollBar Styler
-
color scrollbars

Flash Fixer
-
remove alerts

Roll-Over Maker
-
image roll-overs

Link Cloaker 5
-
encrypt links

Site Capture 3
-
hidden frames

CHMOD 2 Utility
-
chmod utility

BlackBird 3.0
-
browser shell

Zoom 1.0
-
magnifier
MicroTicker.com
-
text scroller

CodeBrain.com
-
java applets

D3Q.com
-
xp icon control

BrainCode.com
-
java applets

MailToProtector
-
protect email
Java Applets
Perl Scripts
Affiliate Program
Index JavaScript
Tip
Index
How do I use a JavaScript link to return
to the previous page?

.
JavaScript includes what is called a history object.  It tracks the URLs visited by the browser. You can use this browser history as a means to return to the previous page (or, for that matter, to go back and forward through the history). This is especially useful when a hard-coded, specific link is not possible; for instance, in cases where you do not necessarily know the address of the previously visited page.  This is how a "previous page" or "go-back" link would appear in your HTML code:

<a href="javascript:history.go(-1)">
Go Back
</a>

Alternatively, if you wanted to go forward instead of backward in the history, you would write the code thus:

<a href="javascript:history.go(1)">
Go Forward
</a>

The numbers in the parentheses are the number of pages to move (forward or back, respectively, in the above examples).  You can also move more than one page; for instance javascript.history.go(-3) would navigate three pages back in the history.  Note that if there is no page in the history to go to, the JavaScript does not error out; it simply does nothing.

Get The Code! CodeLifter is a CodeBrain.com Sister Site
© 1995-2008 OEC Corp & CodeLifter.com
CodeLifter™ & CodeBrain™
Legal Notices


CodeBrain InterNET Group
BrainCode.com CodeFoot.com CodeBelly.com
D3Q.com etLux.com FFFast.com
IEFix.com PopUpWorks.com MicroTicker.com
DavidSosnowski.com OECCorp.com MailToProtector.com
CodeBrain.com



Free MP3
Downloads


Contemporary classical music, completely free.

.