Re: Top warning signs of bad code?
Richard Cornford wrote:
[color=blue]
> Thomas 'PointedEars' Lahn wrote:[color=green]
>> Richard Cornford wrote:[color=darkred]
>>> href="javascrip t:somefunction( )" -wouldn't appear in HTML written
>>> by the informed/experienced, so
>>> can be stated as bad.[/color]
>> Intrinsic event handler attributes have been introduced in HTML 4.01[/color]
>
> They were not introduced, they were formalised, and in the December 1997
> draft of HTML 4.0 according to the HTML specs. That does not mean that
> they will be unavailable on HTML 3.2 user agents.[/color]
The fact that "It is inappropriate to use W3C Working Drafts as reference
material or to cite them as other than 'work in progress'." aside[1],
"HTML 3.2 aims to capture recommended practice as of early [19]96 [...]"[2]
Therefore, it is, on the contrary, highly likely that HTML 3.2 user agents
do not support intrinsic event handler attributes.
[1] <http://www.w3.org/TR/WD-html40-970917/>
[2] <http://www.w3.org/TR/REC-html32>
[color=blue][color=green]
>> and will not work in HTML 3.2 user agents,[/color]
>
> Then you can name those user agents?[/color]
Probably, but I don't have to (prove anything regarding this matter).
[color=blue][color=green]
>> while a `javascript:' URI will work.[/color]
>
> Javascript URIs have never worked on UAs that do not support scripting
> with javascript.[/color]
Of course not, and I have never claimed that the opposite is true.
However, code like
<script type="text/javascript">
document.write(
'<a href="javascrip t:foobar()" onclick="foobar ();'
+ ' return false;">foobar< \/a>');
</script>
is possible and, even more, it provides a way of clean degradation.
[color=blue][color=green]
>> Exactly the informed/experienced will use the above
>> construct to support HTML 3.2 user agents, too,[/color]
>
> No they won't. The attempt would not result in clean degradation on
> unscriptable HTML 3.2 UAs (probably the majority of such browsers)
> [...][/color]
It would, see above.
[color=blue][color=green]
>> i.e. your statement is false.[/color]
>
> Not as worded.[/color]
Of course as worded.
[color=blue]
> <snip>[color=green]
>> The presence of javascript: URIs in source code alone
>> cannot be considered an indicator for bad style;[/color]
>
> HTML source code is specified in my statement.[/color]
Writing HTML source code is possible with client-side scripting.
You stated that the above source code "wouldn't appear in HTML
written by the informed/experienced" which is obviously false.
[color=blue][color=green]
>> that depends on the context.[/color]
> <snip>
>
> The context of providing bookmarkable javascript URIs is the only
> reasonable example of there use in HTML [...][/color]
No, it is not.
PointedEars
--
If at first you don't succeed, call it version 1.0
Richard Cornford wrote:
[color=blue]
> Thomas 'PointedEars' Lahn wrote:[color=green]
>> Richard Cornford wrote:[color=darkred]
>>> href="javascrip t:somefunction( )" -wouldn't appear in HTML written
>>> by the informed/experienced, so
>>> can be stated as bad.[/color]
>> Intrinsic event handler attributes have been introduced in HTML 4.01[/color]
>
> They were not introduced, they were formalised, and in the December 1997
> draft of HTML 4.0 according to the HTML specs. That does not mean that
> they will be unavailable on HTML 3.2 user agents.[/color]
The fact that "It is inappropriate to use W3C Working Drafts as reference
material or to cite them as other than 'work in progress'." aside[1],
"HTML 3.2 aims to capture recommended practice as of early [19]96 [...]"[2]
Therefore, it is, on the contrary, highly likely that HTML 3.2 user agents
do not support intrinsic event handler attributes.
[1] <http://www.w3.org/TR/WD-html40-970917/>
[2] <http://www.w3.org/TR/REC-html32>
[color=blue][color=green]
>> and will not work in HTML 3.2 user agents,[/color]
>
> Then you can name those user agents?[/color]
Probably, but I don't have to (prove anything regarding this matter).
[color=blue][color=green]
>> while a `javascript:' URI will work.[/color]
>
> Javascript URIs have never worked on UAs that do not support scripting
> with javascript.[/color]
Of course not, and I have never claimed that the opposite is true.
However, code like
<script type="text/javascript">
document.write(
'<a href="javascrip t:foobar()" onclick="foobar ();'
+ ' return false;">foobar< \/a>');
</script>
is possible and, even more, it provides a way of clean degradation.
[color=blue][color=green]
>> Exactly the informed/experienced will use the above
>> construct to support HTML 3.2 user agents, too,[/color]
>
> No they won't. The attempt would not result in clean degradation on
> unscriptable HTML 3.2 UAs (probably the majority of such browsers)
> [...][/color]
It would, see above.
[color=blue][color=green]
>> i.e. your statement is false.[/color]
>
> Not as worded.[/color]
Of course as worded.
[color=blue]
> <snip>[color=green]
>> The presence of javascript: URIs in source code alone
>> cannot be considered an indicator for bad style;[/color]
>
> HTML source code is specified in my statement.[/color]
Writing HTML source code is possible with client-side scripting.
You stated that the above source code "wouldn't appear in HTML
written by the informed/experienced" which is obviously false.
[color=blue][color=green]
>> that depends on the context.[/color]
> <snip>
>
> The context of providing bookmarkable javascript URIs is the only
> reasonable example of there use in HTML [...][/color]
No, it is not.
PointedEars
--
If at first you don't succeed, call it version 1.0
Comment