Full-stack JavaScript path (22) IE proprietary extension-document mode, javascript path

Source: Internet
Author: User

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.




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.