|
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]
|