PDA

View Full Version : A link that works like the 'back' button


ssskaya
03-11-2003, 05:06 AM
I need to insert a link on my page that works like the back button of the browser.

how is that possible?

please let me know.

thanks!

brothercake
03-11-2003, 09:44 AM
<a href="previous.html" onclick="javsacript:history.go(-1);return false">previous page</a>

Borgtex
03-11-2003, 09:56 AM
<a href="previous.html" onclick="javascript:history.go(-1);return false">previous page</a>

a little typo :)

redhead
03-11-2003, 05:19 PM
heh... a big typo more like: you dont use the javascript: psuedo thingymajig in event declarations:

<a href="previous.html" onclick="history.back(1); return false;">Back</a>

Borgtex
03-11-2003, 06:38 PM
Originally posted by redhead
heh... a big typo more like: you dont use the javascript: psuedo thingymajig in event declarations:

<a href="previous.html" onclick="history.back(1); return false;">Back</a>


so that's not correct?

<a onClick="vbscript:MsgBox('Message')" href="#">text</a>

brothercake
03-11-2003, 06:48 PM
Originally posted by Borgtex
so that's not correct?

<a onClick="vbscript:MsgBox('Message')" href="#">text</a>

No that's fine. You don't need the javascript: pseudo protocol - like redhead said - but you can use it if you want - specifically useful in your case there, to specify a language. But you can do the same thing with the language attribute of the <a> tag:

<a href="#" language="vbscript" onclick="MsgBox('message')">