Posted by CRON on 10/25/67 11:50
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.
Ciaran
Jonathan N. Little wrote:
> 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]
|