You are here: Re: href="javascript:func()" vs href="#" onclick="javascript:func()" « HTML « IT news, forums, messages
Re: href="javascript:func()" vs href="#" onclick="javascript:func()"

Posted by Jonathan N. Little on 11/02/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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация