[whatwg] document.contentType

> In HTML5, HTML elements in text/html are put in the XHTML namespace and text/html might contain SVG or MathML elements, so you probably want to conditionally call getElementsByTagNameNS based on e.g. the root element's namespaceURI rather than the document's HTMLness.
>

I think the major advantage of document.contentType is to know the value of the Content-Type header (without charset) sent by the server.
This would be good for 3rd party libraries or client side scripts.

Received on Wednesday, 3 June 2009 14:39:09 UTC