About IE8 compatibility: Explanation of the X-UA-Compatible attribute

About IE8 compatibility: Explanation of the X-UA-Compatible attribute

Problem description:


Copy code
The code is as follows:
<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE" />

1. What does this mean?

2. Some examples use "," to separate IE versions, while some use ";", which one is correct?

3. I want to know the meaning of the order IE=9; IE=8; IE=7; IE=EDGE.

In the document, <!DOCTYPE>

reply:

For IE8 and above, for example:


Copy code
The code is as follows:
<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7" />

Force the browser to render according to a specific version of the standard. But IE7 and below are not supported. If separated by a semicolon (;), different browser versions will have different compatibility, for example

Copy code
The code is as follows:
<meta http-equiv="X-UA-Compatible" content="IE=7; IE=9" />

The above shows that IE8 and IE7 are rendered according to IE7 standards, but IE9 is still rendered according to IE9 standards. This allows for different levels of backward compatibility. In reality though, you only need to choose one version:

Copy code
The code is as follows:
<meta http-equiv="X-UA-Compatible" content="IE=8" />

This will be easier for testing and maintenance. A more useful approach is usually to perform simulation

Copy code
The code is as follows:
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />

For IE=EDGE

Copy code
The code is as follows:
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />

This means that the browser will be forced to render according to the latest standards. Just like using the latest version of jQuery from Google's CDN, this is up to date, but may also break your layouts without a fixed version.

Finally, consider this

Copy code
The code is as follows:
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />

Adding "chrome=1" will allow the site to render on clients that use Chrome Frame, but will have no effect on clients that don't.

Copy code
The code is as follows:

For more information, there is plenty to read here, and if you want to learn about ChromeFrame (which I recommend) you can learn about its implementation here.

PS: X-UA-Compatible is a special file header tag for IE8 version, which is used to specify different page rendering modes for IE8. It is not recognized by browsers other than IE8.

Currently, most websites use <meta http-equiv=”X-UA-Compatible” content=”IE=EmulateIE7″ > as a compatibility method for IE8. In order to avoid errors in the produced pages under IE8, it is recommended to directly render IE8 using IE7. That is, add the following code directly to the meta tag of the page header:

Copy code
The code is as follows:

<meta http-equiv=”X-UA-Compatible” content=”IE=7″ /></p> <p><meta http-equiv=”X-UA-Compatible” content=”IE=EmulateIE7″ ></p> <p><meta http-equiv=”X-UA-Compatible” content=”IE=EmulateIE8″ >

But <meta http-equiv=”X-UA-Compatible” content=”IE=EmulateIE7″ > is still the preferred choice.

StackOverFlow original link; http://stackoverflow.com/questions/14611264/x-ua-compatible-content-ie-9-ie-8-ie-7-ie-edge?answertab=active#tab-top

<<:  Solution to Incorrect string value in MySQL

>>:  Teach you how to use Portainer to manage multiple Docker container environments

Recommend

MySQL foreign key constraint (FOREIGN KEY) case explanation

MySQL foreign key constraint (FOREIGN KEY) is a s...

How to use MySQL covering index and table return

Two major categories of indexes Storage engine us...

Some basic instructions of docker

Table of contents Some basic instructions 1. Chec...

In-depth study of how to use positioning in CSS (summary)

Introduction to Positioning in CSS position attri...

Flash embedded in web pages and IE, FF, Maxthon compatibility issues

After going through a lot of hardships, I searched...

Detailed explanation of the usage of position attribute in HTML (four types)

The four property values ​​of position are: 1.rel...

js to implement the snake game with comments

This article example shares the specific code of ...

Talk about nextTick in Vue

When the data changes, the DOM view is not update...

JS function call, apply and bind super detailed method

Table of contents JS function call, apply and bin...

Summary of Nginx location and proxy_pass path configuration issues

Table of contents 1. Basic configuration of Nginx...

How does Vue solve the cross-domain problem of axios request front end

Table of contents Preface 1. Why do cross-domain ...