JavaScript gets IE version code:
var gIE = getIE(); alert() function getIE() { var rmsie = /(msie) ([\w.]+)/; var ua = (); var match = (ua) var result = {}; if (match && > 0) { result = { browser: match[1] || "", version: match[2] || "0" } } return result; }
If there is an error in using the compatibility mode for IE version, you can use the following code:
<meta http-equiv="x-ua-compatible" content="IE=9;IE=8" /> <meta http-equiv="x-ua-compatible" content="IE=9,8" />
Specifies that the browser uses a specific document mode. There are two ways to write content, both of which can be separated by ";" or ","; it has nothing to do with the writing order, and the browser will select the highest version it supports from this list to render using standard mode.
There is another way:
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
The effect that can be achieved in this way is that if GCF is installed, GCF is used to render the page. If GCF is not installed, the highest version of IE kernel is used for rendering. Google Chrome Frame (GCF, Google embedded browser framework). This plug-in can keep users' IE browser unchanged, but when users browse web pages, they actually use the Google Chrome browser kernel, and support multiple versions of IE browsers such as IE6, 7, and 8.
The above is the full content of the JS method to get IE version number and HTML to set IE document mode that the editor brings to you. I hope everyone supports me~