Posted by Dan on 12/02/02 11:50
CRON wrote:
> Cheers again Jonathan,
> But what if you don't want the link to go anywhere? If it is solely
> there to run the javascript function? Is there anything wrong with
> href="javascript:func()" ? It is simple and clean and makes more sense
> to me.
[top-posting snipped -- http://mailformat.dan.info/quoting/ ]
In many (most?) cases, the JavaScript link is there to bring up some
content in some fancy way (like in a popup box), so it would make sense
to have a valid link URL as a graceful degradation in the case of
non-JavaScript-enabled users.
Your function can end with "return false;" in order to suppress the
normal link, so it won't do something annoying like jump around in the
page when JavaScript is enabled.
--
Dan
[Back to original message]
|