Reply to Re: href="javascript:func()" vs href="#" onclick="javascript:func()"

Your name:

Reply:


Posted by Richard Cornford on 06/19/06 06:26

Neredbojias wrote:
> Jukka K. Korpela wrote:
<snip>
>> Using href="javascript:void(0)" does not conform to any
>> published specification, since there is no such spec that
>> defines javascript: URLs. Besides, it fails even on some
>> old browsers that do not recognize such URLs (or pseudo-URLs),
>> despite supporting JavaScript.
>
> Well, javascript:void is a core javascript construct, and
> if the browser supports javascript... Perhaps there is no
> _specific_ _html_ spec citing "javascript:void" verbatim,
> but I hardly consider that a good reason to avoid it's usage.
<snip>

As the activation/execution of javascript pseudo-protocol HREFs are well
known to directly cause numerous issues (usually perceived as problems)
in IE browsers, and an alternative exists that can achieve the same
without provoking those issues, there is no need to look for any other
reason for avoiding their use.

In practice the absence of any formal specification would be expected to
result in inconsistent implementations, and that is what is seen. For
example, while most implementations will react to the javascript
expression evaluating to a non-empty string value by replacing the
current document's contents with that string (interpreted as HTML),
IceBrowser will not replace the document with such a string.

Richard.

[Back to original 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

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