[thelist] IE 6.0 script tip

Liorean Liorean at user.bip.net
Fri Mar 8 03:11:01 CST 2002


At 15:23 2002-03-07 -0500, Eric Vitiello wrote:
><tip author="Eric Vitiello Jr" type="IE 6.0 and script tags">
>         IE 6.0 croaks on some script tags. completely stops rendering the
>   page.  for all you XHTML junkies out there, when including a
>   script in your page, make sure you have a closing script tag,
>   such as:
>
>   <script language="javascript" type="text/javascript"
> src="blah.js"></script>
>
>   NEVER do:
>
>   <script language="javascript" type="text/javascript" src="blah.js"/>
>
>   although this is correct and fine XHTML, IE 6 will choke on it.
></tip>

Learned that the hard way, huh?
In fact, if you read the XHTML 1.0 specs, Appendix C, you'll note the
following text:

~~~~@~~~~
C.3 Element Minimization and Empty Element Content

Given an empty instance of an element whose content model is not EMPTY (for
example, an empty title or paragraph) do not use the minimized form (e.g.
use <p> </p> and not <p />).
~~~~@~~~~

Since script element isn't EMPTY (in the DTD script is declared as
<!ELEMENT script (#PCDATA)> ) it shouldn't use minimised termination, so
any real XHTML junkies should know not to minimise it.

You should be able to use link tag with rel="script" and href="script url"
to include a script though, and thus be able to use minimised termination.
(In the DTD link is declared as <!ELEMENT link EMPTY>.)
I have no idea about compatibility issues with this syntax, though, since I
have never seen it used and have never tried to use it myself.

(And, according to some notes I have, the meta tag should be able to
include a script as well, but don't ask me how.)

// Liorean




More information about the thelist mailing list