Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Most newer browsers have a <code>compatMode</code> but some older browsers don't. Such browsers include Mac IE and older WebKits, such as Safari 2 on desktop and many Nokia phones. </p> <p>If <code>document.compatMode</code> exists, then check that the value is not <code>"BackCompat"</code>. If that is the case, the document is in Standards mode. This gets an early result for IE.</p> <p>Otherwise, there's no <code>document.compatMode</code> and so it is an older browser that might support standards mode rendering, but just doesn't have a <code>compatMode</code> property. </p> <p>If setting an element to have a number value for <code>width</code> sets its width, the document is not in standards mode.</p> <p>You can use <code>if - else</code> if you find it more readable; or, alternatively, use a ternary assignment.</p> <pre> /* 2010-06-26 Garrett Smith - BSD License */ function isQuirksMode(doc) { doc = doc || document; var compatMode = doc.compatMode, testStyle, IS_STANDARDS_MODE = compatMode ? compatMode != "BackCompat" : doc.createElement && ((testStyle = doc.createElement("p").style).width = "1", !testStyle.width); return !IS_STANDARDS_MODE; } </pre> <p>This addresses older Webkit versions which may exist in mobile devices such as Nokias in countries around the world. </p> <p>It will return true in IE5.5 and below. Existence inference check for <code>createElement</code> will fail on any browser that has createElement that is broken (Opera 5, I believe).</p> <p>Avoid using this function to make general inferences; always try to be as specific as possible.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload