Re: Empty script tags cause trouble.

* 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 UTC