The case for avoiding XHTML was pointed out to me by the author of SitePoint’s upcoming DHTML book, as I tut-tutted his use of HTML (as opposed to XHTML) for the book’s sample code.
SitePoint’s DHTML book will be published with HTML.
Stuart’s argument is simple. In order to benefit from the extensibility of XHTML – the XMLness that allows you include other languages like MathML – the document needs to be served with a MIME type of
application/xhtml+xml. But the most popular browser on Earth, Internet Explorer 6, can only render web pages served with a MIME type of
text/html, so you might as well just use HTML as most of the time you won’t get any of the benefits of XHTML anyway.
Sure you can configure your servers to send IE6 a MIME type of
text/html while everyone else gets
application/xhtml+xml, but what’s the point of writing XHTML in the first place? It’s an argument that’s been doing the rounds for some time and I think there’s some valid reasoning there. That said I’m not about to recast Clagnut or Multimap back to HTML.
And why are they insisting on calling it a DHTML book? I am assured the subtitle will include a nod to DOM Scripting, but still. I’m concerned about the stigma attached to the term DHTML – all that browser-specific code branching, falling snowflakes and flying gifs, which is not what this book will be about at all (my understanding is that it will be much more practical). I suppose the thinking is that the general site building public, professional or otherwise, will have a better idea of what DHTML means than DOM Scripting. Shame though.