Posted by Jonathan N. Little on 11/25/13 11:50
CRON wrote:
> Howdy!
> I was wondering which is better to use:
>
> href="javascript:func()"
>
> OR
>
> href="#" onclick="javascript:func()"
>
> Problem is the second one, anchors to the top of the page which is very
> messy in most cases.
>
Better to have
<a href="someRealUrl" onclick="return someJavaScriptFunction()">...
That way if someone has JavaScript disabled they are not left wondering
why the link goes nowhere!
--
Take care,
Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Navigation:
[Reply to this message]
|