Sometimes it’s not obvious how a document is being interpreted by a web browser. For instance, you might write some XHTML 1.1, but the browser actually interprets it as HTML 4. You may be expecting the browser to be using Standards Mode (recommended), but it might actually be using Quirks Mode because you missed the DOCTYPE statement. I’ll periodically update this blog entry to keep track of how to do this stuff in a variety of browsers.

Content Type

Here’s a list of how to determine the content type (text/html, text/plain, application/xhtml+xml) that the browser is interpreting:

  • Firefox: Go to Tools > Page Info. This tells you the type (text/html) and the rendering mode (Quirks or Standard)
  • Opera: Go to View > Panels, then click on the Info button in this panel. You can also click the left edge of the Opera window to get the Panels sidebar open.
  • Konqueror: Go to View > Document Information. This tells you the document type (text/html).

If someone has a clue how to determine the content-type in IE (the developer toolbar didn’t help), Safari, Camino, please drop me a line below…

Rendering Mode

Firefox’s Tools > Page Info dialog box also tells you the rendering mode.

For other browsers, according to this page, you can figure out the rendering mode of your own pages by looking at the DOM document.compatMode value using some JavaScript.

Again, drop me a line below if you know of a way to do this in a specific browser.

§360 · April 19, 2007 · Firefox, JavaScript, Microsoft, Opera, Software, Technology, Tips, Web · · [Print]

Comments are closed.