[whatwg] HTML 5 Script Tag

Aryeh Gregor Simetrical+w3c at gmail.com
Thu Aug 6 14:04:42 PDT 2009


On Thu, Aug 6, 2009 at 4:56 PM, Greg Houston<gregory.houston at gmail.com> wrote:
> This makes sense to me as well. Last week a user of my framework
> posted to the forums asking for help. The JavaScript was not loading,
> and it turned out he was trying to self-close the script tags in the
> header. So for at least some percentage of people the intuited
> expectation is that the script tag can be self-closing like the link
> tag.

This is a problem caused by the use of fake XHTML.  People have been
taught for years now that they should do <link ..... /> even though
it's precisely identical to <link .....> in text/html as far as UAs
actually implement it.  It makes people think there's a difference,
and they expect the difference to make sense.  It doesn't.

The fix is to avoid using or teaching the self-closing syntax in
text/html: just use <link .....> and omit the trailing slash.  This
will work in all UAs and isn't misleading.  Trying to get UAs to
support self-closing syntax on more elements will cause *more*
confusion in the short term, not less, because people will see that it
*does* work in Firefox 3.7 or whatever and assume it works in Firefox
3.5, which it doesn't.


More information about the whatwg mailing list