adahas

අදහස්

Download Day

archive for the 'standards' category

application/xhtml+xml or text/html?

W3C recommends that the content should be served as application/xhtml+xml. But the problem of doing so is that some browsers (such as IE, obviously) doesn’t support the content-type yet. So what’s the decision?

innerHTML in application/xhtml+xml

As you may already know, JavaScript ‘innerHTML’ attribute fails when the document is served with the content-type as application/xhtml+xml. But when the same page is served as text/html, the code works fine. One way to get through is use DOM Object and createRange() method of JavaScript. It works with application/xhtml+xml, but fails in text/html.

So, I tried to build a work-around to write code that will result the same output in both the application/xhtml+xml and text/html.