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

JavaScript jigsaw puzzle game

This article example shares the specific code of ...

mysql5.5.28 installation tutorial is super detailed!

mysql5.5.28 installation tutorial for your refere...

Discussion on the Issues of Image Button Submission and Form Repeated Submission

In many cases, in order to beautify the form, the ...

Detailed explanation of the use of Linux lseek function

Note: If there are any errors in the article, ple...

Example of how to implement embedded table with vue+elementUI

During my internship in my senior year, I encount...

Summary of event handling in Vue.js front-end framework

1. v-on event monitoring To listen to DOM events,...

Implementation of MySQL select in subquery optimization

The following demonstration is based on MySQL ver...

Differences between Windows Server 2008R2, 2012, 2016, and 2019

Table of contents Common version introduction Com...

MySQL 8.0.23 installation super detailed tutorial

Table of contents Preface 1. Download MySQL from ...

Analysis of the Poor Performance Caused by Large Offset of LIMIT in MySQL Query

Preface We all know that MySQL query uses the sel...

How to configure MySQL master-slave replication under Windows

MySQL master-slave replication allows data from o...

VSCode+CMake+Clang+GCC environment construction tutorial under win10

I plan to use C/C++ to implement basic data struc...

Detailed explanation of Vue form binding and components

Table of contents 1. What is two-way data binding...