[pmwiki-users] DOCTYPE suppression is that bad?

Marc Cooper gmane at auxbuss.com
Thu Jul 27 04:26:15 CDT 2006


kirpi at kirpi.it said...
> I have a javascript which works fine in Mozilla, Opera,... but happens
> to have problems in IE.
> I tried and saw that, in case I comment out the doctype
> 
> <! DOCTYPE html
>     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> 
> at the beginning of the template, the javascript works smoothly in IE too.
> Also, I did not notice any negative behaviour overall.
> The whole site *seems* to work fine, still.
> 
> Should I feel safe this way, or anybody of you have a warning agaist
> suppressing such a doctype in pmwiki?

To quote:

"A DOCTYPE Declaration is mandatory for most current markup languages 
and without one it is impossible to reliably validate a document. The 
DOCTYPE defines the version of the document like : HTML 4.0.1, XHTML 
1.0, 1.1, etc."

The behaviour of, in this case, a browser will change depending on the 
content of the DOCTYPE. In other words, behaviour cannot be guaranteed - 
or, at least, expected behaviour ;-) - without it. So, despite your site 
appearing to work okay now - at least in the browsers you have tested - 
it might not work later.

So, to fix your problem, first use the appropriate DOCTYPE - it's 
mandatory after all - then start fixing the Javascript.

-- 
Best,
Marc





More information about the pmwiki-users mailing list