Click back

liunx

Guest
Hello,<br />
<br />
I've got this that takes the user to the previous page using in image as a back button - <br />
<br />
<img src=http://www.webdeveloper.com/forum/archive/index.php/"images/back.gif" onClick="history.go(-1)"><br />
<br />
How do I get the same thing to work but using 'back' as text?<br />
<br />
Cheers<!--content-->Here you go ashers. Fairly simple however i would reccomend not using JavaScript as an essential part of your navigation. Anyway here is the code. <br />
<br />
<br />
<a href=http://www.webdeveloper.com/forum/archive/index.php/"javascript:history.back()">back </a><br />
<br />
<br />
Hope that helps:<br />
Best Wishes, <br />
David<!--content-->Two things, javascript: should only be used for making bookmarklet links not for calling JavaScript with the href. Also since this link will only work for JavaScript enabled browsers it shold be hidden from non-JavaScript enabled browsers so as not to cause confusion.<script type="text/javascript"><!--<br />
document.write('<a href=http://www.webdeveloper.com/forum/archive/index.php/"#" onclick="history.back()">back</a>');<br />
//--></script><!--content-->
 
Back
Top