The difference between IE browser mode and document mode--lets you turn on IE browser compatible understanding spring

Source: Internet
Author: User

One. Browser mode

Definition: Switch The default document mode of IE for the webpage, annotate the conditions of different versions of the browser, and send the value of the user agent (User-agent) string to the Web server. Web sites can determine the browser's version and installed functionality based on the different user-agent strings returned by the browser, so that different page content can be returned to different browsers. is to tell the server, browser version and features.

By default, IE8 's browser mode is IE8. Users can manually switch to a different browser mode by clicking the Compatibility View button next to the Address bar. In IE8, IE8 compatibility View displays Web pages in IE7 document mode and sends IE7 user-agent strings to the server.

Function: To be compatible with the earlier version of IE, it will control the browser issued by the useragent, indicating which version of the browser to make the request, in order to allow the code designed for a specific IE version of the correct execution (for example: some of the code really judge IE version, there are also CSS to determine the version of IE).

Two. Document mode

Definition: Specifies which version of the page layout engine (Trident) of IE is used to parse and render the page code. Switching the document mode causes the page to be refreshed, but the version number in the user agent string is not changed and the page is not re-downloaded from the server. When you switch browser mode, the browser automatically switches to the appropriate document mode.

Role: The main function of the document mode is to affect the way the browser displays Web page HTML, after receiving the returned HTML file, decide which IE version of the document mode to resolve the page (for example: JS script is dependent on the document mode, IE9 JS changes need to IE9 document mode to support).

In short: The change in browser mode, the ability to change the value of the user agent in the request, so that the server gets, can follow the value of the UA to the corresponding processing (if the server has this processing function). Changes to the document schema are only reflected in the local browser parsing HTML, which has an impact on the client display and is transparent to the server. At the same time, modifying the browser mode affects the document mode, which is not true. For example, if your browser mode is selected IE8, then the document mode is only IE8 earlier than the previous ie7,ie5, and not IE9, higher. If your browser mode is to choose IE10, then the document mode is IE10 and earlier than IE10 ie9,ie8 and so on.

The difference between IE browser mode and document mode--lets you turn on IE browser compatible understanding spring

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.