[thelist] best way to create "back" button

Michiel Trimpe M.B.Trimpe at student.tue.nl
Sat Aug 10 14:18:02 CDT 2002

I tend to use something like this (PERL):

print "<a href=\"" . $ENV{'HTTP_REFERER'} ||
"javascript:history.back(1)" . "\">BACK</a>" ;

JY> JavaScript and the referer are pretty much the ways to do this.  As you've
JY> mentioned though, neither are completely reliable since user agents aren't
JY> required to implement them.  You can combine them by using document.write() to
JY> write out the link and placing the referer variable in a <noscript> tag to
JY> cover those agents without JavaScript, but you still won't get the full 100%
JY> of your audience.

Best regards,
 Michiel                            mailto:M.B.Trimpe at student.tue.nl

More information about the thelist mailing list