View Full Version : "Back" button
02-11-2004, 02:37 PM
Could someone please tell me what code I need to use to create a "back" button link (same function as a browser back button)?
Thanks very much!
02-11-2004, 03:39 PM
I ran across it here in the forum but I can't remember where it is so here's the code that I use.
// Return to the previous page
<input type="reset" value="BACK" onClick="GoBack()">
You can just change the number in the history.go(#) to go back more than one page.
02-28-2004, 06:45 PM
Here is an easier way.
01-25-2007, 03:47 AM
Can I just say a 'BIG THANKS" to OLDCRAZYLEGS.....
All solutions worked fine in IE7...but none worked in FF2.0.
The screen would momentarily flicker back to the previous page, and then land back on the one that made the call.
I used 'window.location = history.go(-1);'
.... and placed this within a function in the head of the page (returnto lastpage();), and called that function from the html doc via the <a href="#" onclick = "returntolastpage();"> pic to click </a> method.
This worked fine in IE, but not in FF. I tried all manner of permatations, but with the same result.
However this embedded 'inline' method of OLDCRAZYLEGS works in both browsers, and has saved me some grief! .... many thanks guys.
01-25-2007, 06:21 AM
Why clutter up the code with things that aren't needed. Here's the short version:
01-26-2007, 05:01 AM
First I am not a programmer. I just found these scripts elsewhere. It seems to me the easiest way is.......
For back button I use: history.go(-1)
For forward button I use: history.go(+1)
I simply do not understand for example:
For that matter, neither does Avant browser (which is what I am putting scripts like the ones I listed into). Whenever I post requests for help and I get a response with two segments (script and body) I never know how to add the body portion so that Avant recognizes it.
Anyway, as I originally stated, the two listed above seem simplest and shortest.
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.