[thelist] href=# versus href=JavaScript.....

aardvark roselli at earthlink.net
Thu Feb 22 01:57:58 CST 2001


> From: Scott Dexter <sgd at ti3.com>
>
> I thought href=# was the more proper of the two (considering '#' is
> used for an inline anchor); and --not that this validates the
> statement-- I've watched browsers puke on a href=javascript: call, and
> that's outside the cases where javascript is just turned off ...

for the *very* few cases where i use JS on a link, i prefer to stick it 
in the href instead of an onclick handler for two (what i think are) 
very important reasons:

- it doesn't force the page to reload or scroll all the way to the top 
(as some browsers do)...

- it shows the user that it's a JS link and what the function is, 
thanks to the browser's feature of displaying an href in the status 
bar...

and since the browsers that can't handle the JS in the href usually 
can't handle the JS anyway, it's a no-brainer for me...

dig?




More information about the thelist mailing list