Page 1 of 1

A quick tip: #top

Posted: Tue Apr 08, 2003 6:21 pm
by phice
Just noticed this on a few webpages...

Instead of creating a <a name="top"></a> at the top of every single page, you can simply use:

Code: Select all

<a href="javascript:scroll(0,0);"></a>
where you want the "up" link/text placed. Correct me if I'm wrong.

Posted: Wed Apr 09, 2003 2:08 am
by twigletmac
You shouldn't really have an empty anchor tag but at least:

Code: Select all

<a name="top">...</a>
is cross-browser compatible:

Code: Select all

<a href="javascript:scroll(0,0);"></a>
relies on JavaScript being enabled and would be useless in browsers that may not support it (i.e. text to speech browsers).

IMHO, a standards complient HTML solution is 10x better than a JavaScript solution, especially when it is very important to the navigation of the page.

Mac