W3C home > Mailing lists > Public > www-html@w3.org > February 2002

Re: Empty script tags cause trouble.

From: Thomas Hurst <tom.hurst@clara.net>
Date: Sat, 16 Feb 2002 16:32:57 +0000
To: www-html@w3.org
Message-ID: <20020216163257.GD76762@voi.aagh.net>
* Edwin van Vliet (cheatah@50hertz.net) wrote:

> <script type="text/javascript" src="somescript.js" />
>
> While the normal method works as expected:
>
> <script type="text/javascript" src="somescript.js"></script>

> 1: a bug in a lot of editors and even browsers
> 2: a bug in the w3 validator
>
> Or might there be other things I didn't think of?

3: Most browsers parse XHTML just like they parse bog standard HTML
(i.e. as bastardised SGML), taking the (to them) superfluous '/'
attributes in their stride (by ignoring them).

Since very few browsers know about XML, you're better off explicitly
closing tags like that.  Even if you're looking at it from an XML point
of view, they're looking at it from a HTML tag-soup point of view most
of the time :)

-- 
Thomas 'Freaky' Hurst  -  freaky@aagh.net  -  http://www.aagh.net/
-
Rich bachelors should be heavily taxed.  It is not fair that some men
should be happier than others.
		-- Oscar Wilde
Received on Saturday, 16 February 2002 11:33:04 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:15:50 GMT