Blog » Why use XHTML at all?

Why use XHTML at all?

I decided to add a Google Adsense bar discretely at the bottom of the page, and once again, I had trouble with Firefox. Internet Explorer displayed the page just fine, but Firefox added the new advertisement below the existing ads at the top of the page.

This is the second time that I have had trouble with XHTML and Firefox. The first issue was due to Firefox not supporting the Document.write() Javascript method. I solved this by using Weston Ruter's Javascript code that replicated the missing method when needed. Unfortunately, Weston Ruter's script does not support a special case in which two Document.write() calls are separated by more HTML code; This is exactly what occurs when two Adsense units are placed on different parts of the page. Weston Ruter is aware of this defficiency, but is not sure if it is worth fixing. 

My solution is much simpler: delete the XML tags at the top of the page and change the page doc-type to plain HTML. Making this change instantly solved the advertisement placement error, and as a bonus, the page suddenly opened in the OWB browser on Amiga OS 4.0 too. The old XHTML version of the page caused OWB to crash. As this site has (or will have) a lot of content geared toward Amiga OS 4.0, not having a single Amiga OS 4.0 browser that is able to view this site properly would be a big problem. 

This begs the question, why use XHTML in the first place? It appears that XHTML support in various browsers is problematic; The same page source-code that works fine as plain HTML causes trouble in various browsers if it is XHTML. XHTML is essentially a variant of HTML with stricter rules regarding the tags. As far as I can tell, what you can do in XHTML, you can do in HTML as well. Given all of the above, I think that it is worth asking why someone should use XHTML over HTML. If anyone has some convincing arguments for using XHTML, please feel free to add a comment to this page.

Blog » Why use XHTML at all?

Post your comment


No one has commented on this page yet.

RSS feed for comments on this page | RSS feed for all comments

Blog » Why use XHTML at all?