You are here: Re: stopping <a> from loading new page but still performing onclick action « PHP Programming Language « IT news, forums, messages
Re: stopping <a> from loading new page but still performing onclick action

Posted by Nick D on 12/16/54 11:57

All of the examples in this thread are depreciated. None of them will
degrade gracefully. You should ALWAYS use the (<a
href="action_page.html">Link</a>) Then attach an onload javascript
function that will run through all link tags and add the proper onclick
event and removing the traditional "href" properties. This way your
script will ALWAYS work even if javascript is disabled.

Reference: http://www.w3.org/TR/WCAG10-HTML-TECHS/


Good Man wrote:
> "Nick D" <nick.denardis@gmail.com> wrote in
> news:1157393471.762756.201500@m79g2000cwm.googlegroups.com:
>
> > Sometimes this could cause a problem by jumping to the top of the
> > page. Another way to do this without making the page jump would be to
> > put (<a href="javascript:void(0)" onclick="SomeFunction()">)
>
> i usually call:
>
> <a href="javascript://Click To Change Divs" onclick="changeDiv();">
>
>
> i believe my example is proper coding practice - any href="javascript:xxx"
> should be avoided at all costs.
>
> best,
> gm

 

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

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