Quantcast
Channel: Antanova Ltd. » html
Viewing all articles
Browse latest Browse all 7

Why I don’t use XHTML

$
0
0

Although this is a pretty old topic, and people have decided to come down on one side or the other already, I was reminded of the debate recently. I was looking at some code another dev had done, and was altering it to suit my style more. There was nothing wrong with it, but the tags were done in the XHTML style rather than HTML.

Now, way back when, I thought that XHTML was going to be the saviour of the web, and it was closely intertwined with the move away from table-layout to a more semantically correct layout. So I have coded a fair few sites using XHTML. In recent years, though, I have switched back to HTML. I have my reasons. And they are:

  1. IE does not support XHTML. It can render (modified) XHTML code served as HTML, but that’s not the point, is it? If you add the proper <![CDATA[ sections, you then have to comment them back out. That seems to be a waste of time and of bandwidth to me. The XML prologue that should appear at the start of the file has to be removed, too or else IE6 chokes on it. Yes, I still have to support IE6.
  2. In the case of an error in the markup, properly-served XHTML completely fails. Now, this can be a benefit, as it will show the error up during testing and force you to output well-formed XHTML, but I’m not sure I trust all the JavaScript based editors that many users use to input content with to output flawless code every time.
  3. The JavaScript document.write cannot be used. Adding elements using DOM methods is better, yes, but sometimes a quick hack is what’s needed, or code from an external source (like Google Analytics, for example) uses it.

I expect things to change on the code front as HTML 5 becomes more supported and as I start to integrate its code into my sites. It might mean that the move to XHTML starts to make more sense than it does to me right now. It’s something I will keep reassessing, and if I read a convincing enough argument to change then I will.


Viewing all articles
Browse latest Browse all 7

Latest Images

Trending Articles





Latest Images