javascript document compatMode

compatMode NN 7 IE 6 DOM n/a

 

Read-only

Returns the compatibility mode for the document, as controlled by the DOCTYPE element's content. See the DOCTYPE element discussion for details on how to force the browser to treat a document in either backward compatibility or standards compatibility mode for element positioning and other implementation details. Because the choice of mode can impact some style property results, you can use this property to branch between two calculations in a shared library so that they treat the current document correctly, regardless of mode.

 
Example
 
if (document.compatMode == "BackCompat") {
    // process as if IE 5.5 or earlier or Netscape "quirks" mode
}
 
Value

String constant: BackCompat | CSS1Compat.

 
Default

BackCompat


538,Nickname,Homepage or email,Comments here,Add comment