Kevin Yarmak wrote:
[color=blue]
> If an older browser "sees" the TYPE attribute, it ignores it.[/color]
Most certainly.
[color=blue]
> If a newer broswer "sees" the LANGUAGE attribute, it also ignores it.[/color]
No.
[color=blue]
> You can provide as many illegal attributes in any HTML tag as you like![/color]
There is nothing like "illegal" attributes. Either a document conforms to
a HTML specification or it does not. Either it is Valid HTML or it is no
HTML at all. BTW: HTML parsing is not restricted to Web browsers, and even
then there are a user agents out there that use strict SGML parsers.
[color=blue]
> example:
>
> <input id="blah" bbfgbbb="Hello World!">
> <script id="scriptId" megaId="custom id"></script>[/color]
The `script' element does not have a `megaId' attribute, this is invalid
HTML, i.e. *no* HTML. Tagsoup parsers will silently ignore it, SGML
parsers will yield an error and are allowed to display nothing else but
the error.
[color=blue]
> <script type="text/javascript" language="javascript">[/color]
This can be included in Valid HTML 4.01 Transitional only.
[color=blue]
> <!--[/color]
Scripts do not need to/should not be commented out this way any longer.
[color=blue]
> alert(document.getElementById("blah").bbfgbbb)
> alert(document.getElementById("scriptId").megaId)[/color]
Although this is a test case, note that this kind of referring to
objects is known to be error-prone and therefore not recommended.
<http://pointedears.de/scripts/test/whatami>
[color=blue]
> //--></script>
>
> My conclusion is that the LANGUAGE attribute still servers a purpose --
> for older browers.[/color]
You are mistaken. language="JavaScript1.2" affects Mozilla's behavior,
that's all.
[color=blue]
> You never know, maybe one outta a hundred of the guests to your website
> will have an old browser.[/color]
A browser older than 10 (in words: TEN!) years?
[color=blue]
> It may be extra typing to also include the LANGUAGE attribute but it
> does still serve a purpose -- these older browers.[/color]
No, it does not. Those older browsers do not need that attribute, as you
have correctly stated above. It is because there is no HTML specification
or UA reference that says that the attribute must be included and no
ECMAScript specification that says the value of that has to be "javascript"
and the like for the script to be executed by a JavaScript/ECMAScript
conforming script engine.
[color=blue]
> It can't hurt to include the LANGUAGE attribue because it's not gonna
> cause any browers to mis-behave.[/color]
It can hurt if you use a Strict document type or XHTML 1.1+. It is simply
Voodoo: You know that it most certainly changes nothing but you include it
anyway, wasting your time and disk space and the time and bandwidth of your
visitors whose user agents have to download, parse and error-correct it.
[color=blue]
> *** Sent via Developersdex
http://www.developersdex.com ***[/color]
Of course. Lots of Voodoo coding originates at this source.
PointedEars
--
"Auf dieser Seite finden Sie Tip's, Trick's und Link's zu Handy's von
verschiedener Hersteller" -- Ich glaube, damit ist hinlänglich bewiesen,
daß die Funkstrahlen von Handys schädlich fürs Gehirn sind.
(g'f'nd'n ''f
http://members.aol.com/apostrophs/apostrophen.htm)