Mozilla.com

  1. MDC
  2. Main Page
  3. DOM
  4. document.compatMode

« Gecko DOM Reference

Summary

Indicates whether the document is rendered in Quirks mode or Strict mode.

Syntax

mode = document.compatMode 
  • mode is a string containing "BackCompat" for Quirks mode or "CSS1Compat" for Strict mode.

Example

if (document.compatMode == "BackCompat") {
  // use some quirky stuff
}

Notes

There is a third mode, Gecko's "Almost_Standards" Mode, which only differs from Strict mode in the layout of images inside table cells. This third mode is reported the same way as Strict mode: "CSS1Compat".

Specification

Not part of any standard.

MSDN: compatMode property

Languages

Page last modified 20:59, 19 Jul 2008 by George3

Files (0)