In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article analyzes "how to make IE8 browsing automatically use IE7 compatibility mode". The content is detailed and easy to understand, and friends who are interested in "how to make website IE8 browsing automatically use IE7 compatibility mode" can follow the editor's train of thought to read it slowly and deeply. I hope it will be helpful to everyone after reading. Let's follow the editor to learn more about "how to make IE8 browsing automatically use IE7 compatibility mode".
Preface
To help ensure that your web page has a consistent look and feel in all future IE versions, IE8 introduces file compatibility. Introducing an additional compatibility mode in IE6, file compatibility allows you to choose a specific compilation mode when IE renders your web page.
The new IE introduces file compatibility in order to ensure that web pages will have a look and feel in future versions. When you introduce an additional compatibility mode
This article explains the need for file compatibility, lists the file compatibility modes that can be used by existing versions of IE, and demonstrates how to select a specific compatibility mode.
The need to understand file compatibility
New features in each major version of IE are designed to make browsers easier to use, more secure, and more supportive of industry standards. With these as features of IE, one of the risks is that the older version of the site does not display correctly.
To minimize this risk, IE6 allows web developers to choose how IE compiles and displays their web pages. "Quirks mode" is the default, which makes the page appear from the point of view of older browsers, and "Standards mode" (also known as "strict mode") features the best support for industry standards. However, to take advantage of this enhanced support, the web page must contain the appropriate instructions.
If a web page does not contain an instruction, IE6 will display it as quirks mode. If the web page contains a valid instruction but the browser cannot recognize it, IE6 will display it as IE6 standards mode. Because a few websites already contain instructions, the compatibility mode switch is quite successful. This allows web developers to choose the best time to transfer their pages to standards mode.
As time goes by, more websites begin to use standards mode. They also began to use the features and functions of IE6 to detect IE. For example, IE6 does not support universal selector (the global selector of css * {}), and some websites use it to make specific mappings for IE.
When IE7 adds support for global selectors, sites that rely on IE6 features will not be able to detect this new version of the browser. As a result, specific correspondence for IE cannot be applied to IE7, causing these sites to fail to display as they expected. Since only two compatibility modes are supported, affected site owners are forced to update their sites to support IE7.
IE8 supports industry standards more than any previous version of the browser, so web pages designed for older browsers may not render as expected. To help alleviate all problems, IE8 introduces the concept of file compatibility so that you can choose a specific IE version for your web design. File compatibility adds some new modes to IE8 that tell browsers how to parse and compile a web page. If your page does not display correctly in ie8, you can update your site to support the latest web standards (preferences) or add a meta element to your page to tell IE8 how to compile your page according to the old version of the browser.
This allows you to choose the time to update your website to support the new features of IE8.
Recognize the file compatibility mode
IE8 supports several file compatibility modes, which have different features and affect the way content is displayed.
Emulate IE8 mode instructs IE to use instructions to decide how to compile the content. The Standards mode instruction is displayed as IE8 Standards mode and the quirks mode is displayed as IE5 mode. Unlike IE8 mode,Emulate IE8 mode, it attaches importance to instructions.
Emulate IE7 mode instructs IE to use instructions to decide how to compile the content. The Standards mode instruction is displayed as IE7 Standards mode and the quirks mode is displayed as IE5 mode. Unlike IE7 mode,Emulate IE7 mode, it attaches importance to instructions. This is the most recommended compatibility mode for many web pages.
The content of IE5 mode compilation is like the display of IE7's quirks mode, which is very similar to what is shown in IE5.
IE7 mode compiled content is like the display of IE7's standards mode, regardless of whether the web page contains instructions or not.
IE8 mode provides the highest support for industry standards, including W3C Cascading Style Sheets Level 2.1 Specification and W3C Selectors API, and limited support for W3C Cascading Style Sheets Level 3 Specification (Working Draft).
Edge mode instructs IE to display content in the highest mode currently available. When using IE8, it is equivalent to IE8 mode. If (assuming) IE that supports a higher compatibility mode is released in the future, pages that use Edge mode will display content in the highest mode supported by that version. The same pages will be displayed as usual when browsing with IE8.
Because edge mode uses the highest mode supported by this version of IE to display the content of the web page it is recommended to use only for test pages and other non-commercial pages.
Specify file compatibility mode
To specify the file mode for your page, you need to use the meta element to put the X-UA-Compatible http-equiv header in your page. The following is an example of being designated as Emulate IE7 mode compatibility.
My Web Page
Content goes here.
Its content changes with the specified page mode, and when you want to simulate IE7, specify IE=EmulateIE7, specify IE=5, IE=7, or IE=8 to select one of the compatibility modes. You can also specify IE=edge to instruct IE8 to use the highest mode it supports.
X-UA-compatible headers are not case-sensitive. However, except for the title element and other meta elements, it must appear in front of other elements in the header section of the web page.
Set up the website server to specify the default compatibility mode
Webmasters can preset a specific file compatibility mode for their sites by defining a custom header for their sites. This particular method depends on your website server. For example, the following web.config file enables Microsoft Internet Information Services (IIS) to define a custom header to automatically compile all web pages using IE7 mode.
If you have specified a default file compatibility mode on the web server, you can override it by specifying different file compatibility modes on individual pages. The mode specified in the web page takes precedence over the mode specified in the server.
Please check your website server for information about specifying custom headers, or see more information:
Implementing the META Switch on Apache
Implementing the META Switch on IIS
Determine file compatibility mode
To determine the file compatibility mode of a web page when browsing with IE8, use the documentMode function of document object (document object). For example, entering the following code in the URL column of IE8 will display the document mode of the current page.
_ javascript:alert (document.documentMode)
The documentMode function returns a value corresponding to the file compatibility mode of the current page. For example, if the page is specified to support IE8 mode, documentMode will return the value "8".
The compatMode feature introduced in IE6 does not support the documentMode feature introduced in IE8. Applications currently built using compatMode can also work in IE8, but they must be updated to use documentMode.
If you want to use JavaScript to determine the compatibility mode of a document, the code introduced in the following example supports older versions of IE.
Engine = null
If (window.navigator.appName = = "Microsoft Internet Explorer")
{
/ / This is an IE browser. What mode is the engine in?
If (document.documentMode) / / IE8
Engine = document.documentMode
Else / / IE 5-7
{
Engine = 5; / / Assume quirks mode unless proven otherwise
If (document.compatMode)
{
If (document.compatMode = = "CSS1Compat")
Engine = 7; / / standards mode
}
}
/ / the engine variable now contains the document compatibility mode.
}
Cognitive content attribute value
The content attribute value is flexible when it receives a value that is different from the previously described value. This will give you more control over how IE displays your web page. For example, you can set the content property value to IE=7.5. When you do this, IE tries to convert this value to version vector and selects the closest result. In this example, IE sets it to IE7 mode. The following example shows how the mode is set to other values.
Note: the previous example shows individual content values. In fact, IE will only execute the first X-UA-Compatible header in the page.
You can also use the content attribute to specify a plural file compatibility mode, which will help ensure that your web page will be displayed consistently in future browser versions. To set a plural file mode, set the content properties to identify the mode you want to use. Use semicolons to separate patterns.
If a particular version of IE supports more than one compatibility mode, list usage as the highest available mode in the header content property. You can use this feature to exclude specific compatibility modes, although this is not recommended. For example, the following header excludes IE7 mode.
Compatibility is a very important concern for web designers. Although it is best to build a site that does not rely on any web browser features or functions at all, sometimes this is not possible. File compatibility mode restricts web pages to a particular version of IE.
Use the X-UA-Compatible header to specify which IE version your page supports. Use document.documentMode to determine the compatibility mode of the page.
By choosing to support a particular version of IE, you can ensure that your page will be displayed consistently in future browser versions.
1.
It's like using Windows Internet Explorer 7's Quirks mode, which is very similar to the way Windows Internet Explorer 5 displays content.
two。
Whether the page contains instructions or not, it seems to use the standard mode of Windows Internet Explorer 7.
3.
4.
The Edge mode tells Windows Internet Explorer to display content in the highest level of available mode, which actually breaks the "locked" mode.
5.
The EmulateIE7 mode tells Windows Internet Explorer to use instructions to determine how to render the content. Standard mode instructions are displayed in Windows Internet Explorer 7 standard mode, while Quirks mode instructions are displayed in IE5 mode. Unlike IE7 mode, EmulateIE7 mode follows instructions. For most websites, it is the preferred compatibility mode.
On how to make the website IE8 browsing automatically use IE7 compatibility mode to share here, I hope that the above content can make you improve. If you want to learn more knowledge, please pay more attention to the editor's updates. Thank you for following the website!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.