Full-stack JavaScript path (22) IE proprietary extension-document mode, javascript path
Ie8 introduces a new concept, "document mode". The document mode of the page determines what functions can be used. That is to say, the "document mode" determines the level of css you can use and what APIs you can use in javascript,
And how to treat the document type (doctype ).
You can modify the parameters in either of the following ways:
Var mode = document.doc umentMode;
Knowing what document mode the page uses helps you understand the page behavior. This attribute can be accessed in any document mode.
In IE 11, the mode value may be 5, 7, 8, 9, 10, 11.
Edge: always render pages in the latest document mode. Ignore the document type declaration. For IE10, the page is always rendered in IE10 standard mode. For IE11, the page is rendered in IE11 standard mode.
EmulateIE9: if a document type declaration exists, the page is rendered in IE9 standard mode. Otherwise, the document mode is set to ie5.
EmulateIE8: if there is a document type declaration, the page is rendered in IE8 standard mode; otherwise, the document mode is set to ie5.
EmulateIE7: if there is a document type declaration, the page is rendered in IE7 standard mode; otherwise, the document mode is set to ie5.
Article 9: force the page to be rendered in IE9 standard mode and ignore the document type declaration.
4.1.8: force the page to be rendered in IE8 standard mode and ignore the document type declaration.
7: The page is rendered in IE7 standard mode and the document type declaration is ignored.
Article 5: forcibly set the document mode to IE5 and ignore the document type declaration.
Use the X-UA-Compatible header (or on the server) to specify the IE version supported by your page. Use document.doc umentMode to determine the page compatibility mode.