Posted by Andy Dingley on 05/31/06 10:36
SlimBiker wrote:
> <script type="text/javascript" src="./js/global.js" />
> I am using XHTML 1.0 transitional and page validates to W3C.
> Any idea why this could be???
Well known IE problem.
Don't serve XHTML as XML - the web (and particularly IE) just aren't
ready for it yet. If you must use XHTML, then use Appendix C as well
and serve it as text/html (search the c.i.w.a.h archives for much
discussion of this). Don't try either until you have some understanding
of DTDs.
When generating XHTML for use anywhere near a traditional HTML parser,
then make sure you avoid the XML behaviour of treating elements that
are empty and elements that have no content as equivalent. This isn't
true under SGML or HTML: <script></script> is _different_ to <script />
Only output empty elements (single empty tag) for elements that are
defined to be empty in the HTML DTD, such as <br />, <hr />, <link />
and <meta />. For <script> you MUST ensure that it never appears in
the <script /> form -- if you're using XSLT to generate your pages then
you might need to slip a white space character into it to stop "XML"
output changing it. XSLT doesn't understand Appendix C and can't
generate it automatically.
[Back to original message]
|