After a sleepless night or two, I just discovered this bug in Internet Explorer the hard way.
script tags. This is how my tag looked.
This works like a dream everywhere, except in the world's most popular browser. In IE, the entire page is just blank! The markup is downloaded properly (I can see it when I view source), even my CSS
background-color is applied to the page, but there's absolutely nothing on it! I blamed my content-negotiation scripts first (I am serving HTML Transitional to IE and XHTML everywhere else), and then on IE's support for CSS (I thought I made a grave little mistake somewhere). However, on removing this tag, everything worked fine in IE.
Turns out, IE doesn't like the
script tags if they are using element minimization. I got the page rendering just as I intended by changing the tag to look like this:
Doing some research, I came across this post in theList by Eric Vitiello which clarifies this more. Apparently the DTD declaration for the
script tag says
<!ELEMENT script (#PCDATA)>, and the XHTML specs says (under Appendix C. 3):
Given an empty instance of an element whose content model is notSo, I guess this isn't really a bug in IE. I'd think instead, that this is a bug in the DTD itself. The script tag doesn't have to contain
EMPTY(for example, an empty title or paragraph) do not use the minimized form (e.g. use
<p> </p>and not
#PCDATA(in fact, I consider it graceful if it doesn't), and forcing it is, well, stupid.
For now, I am explicitly closing the script tag with a seperate closing tag, and everything seems to be working well. Does anyone have any idea about handling this better, preferably with minimized element closures?