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

Charles F. Johnson charles at littlegreenfootballs.com
Thu Feb 22 14:03:47 CST 2001


Tab Alleman <talleman at autobex.com> typed:

> I know there's no shortage of pennies here, but I too have had cases where
> href="javascript: ..." didn't work, but href="#" onclick="..." did work.  I
> haven't discerned the pattern, so my solution is to try href="javascript"
> first, and if it doesn't work, switch to href="#".  (Then if THAT doesn't
> work, I debug my script.. :)

sorry for posting this again, but looks like my 2 cents got missed the first
time around! if for some reason you don't want to put your main javascript
code in the href, i've been able to get around the problems with href="#"
(specifically, reloading the page) by using a null javascript function for
the href attribute, like this:

href="javascript:;" onClick="etc. etc."

charles johnson
lgf web design
http://littlegreenfootballs.com





More information about the thelist mailing list