[thelist] rollover behaviour

Joshua Olson joshua at waetech.com
Tue Feb 10 06:55:47 CST 2004

> -----Original Message-----
> From: john at johnallsopp.co.uk
> Sent: Tuesday, February 10, 2004 6:29 AM
> I'm trying to implement a text '<back' link from a glossary page, which
> takes the viewer back to the previous page.
> This works: <a onClick="history.back(1);" class="dlink">&lt;back</a> but
> the text doesn't rollover properly in IE6 (it does in Moz).


A few people have already responded to this question, but I want to suggest
a solution that provides a way for non-JS enabled people to follow the back
link as well:

<a href="thepreviouspage.php" onclick="history.go(-1); return

The "return false" in the onclick handler is how you request that the
browser not go to the page in the href attribute.

FYI, You can use a similar trick when you need a popup window:

<a href="thepage.php" onclick="window.open(this.href, '_blank', 'width=xxx,
height=xxx'); return false;" target="_blank">Go to page</a>

This solution is elegant because JS users will get the page in the new
window as expected, and non-JS users will still get a new window as well...
but it simply won't be of the specified width and height.

Best of luck,

Joshua Olson
Web Application Engineer
WAE Tech Inc.

More information about the thelist mailing list