Movabletripe now validates as HTML 3.2!

April 6th, 2005

Sure, this site’s doctype might say XHTML 1.0 Strict and validate as such, but as the more astute of you already know, that means SFA as far as your browser is concerned as long as the document is delivered as text/html. Make no mistake about it. Your browser will effectively render any page delivered as text/html as tag soup; that is to say, the same way it would render HTML 3.2.

Admittedly, it will be the most semantic HTML 3.2 known to man, but unless your browser is delivered a Content-Type of application/xhtml+xml, it will not render the page any differently.

So what is this rant all about? Well I have been in the process of creating a Wordpress plugin which checks whether a user’s chosen browser accepts application/xhtml+xml and then delivers custom response headers and a suitable doctype to match. The good news is that it works a treat. The bad news is that it does not work on my site. (Or more appropriately, my site does not work with it!) There are two major hurdles I encountered:

  1. Any whitespace before the XML declaration brings a page to a grinding hault
  2. Most importanly, my javascript no longer works

The whitespace issue was easily resolved, but the javascript problem has me scratching my head. I use javascript on this site for two purposes: for the comments preview, and the Stinky Links rollover titles. With my pages delivered as application/xhtml+xml neither of them work.

I realise it is nothing more than non-DOM-compliant ECMAScript on my part, but to put it bluntly, stuffs me if I can get it to work without it. I know the comments preview relies on .innerHTML, but I can’t seem to be able to substitute it for any other code that will actually work the same. I have seen a few workarounds using createElement(), createElementNS() and node.appendChild(), but I have had little luck with these.

If anyone out there in teh interweb can help me out with this I would be very grateful. It is the only thing holding me back from XHTML 1.1 goodness.

This entry was posted on Wednesday, April 6th, 2005 at 8:04 pm and is filed under Web Standards. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply

XHTML: Permitted tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>