JAVASCRIPT gets the IE version number and HTML sets the IE document mode JavaScript gets the IE version code:
var gIE = getIE(); alert(gIE.version) function getIE() { var rmsie = /(msie) ([\w.]+)/; var ua = navigator.userAgent.toLowerCase(); var match = rmsie.exec(ua) var result = {}; if (match && match.length > 0) { result = { browser: match[1] || "", version: match[2] || "0" } } return result; }
If an error occurs in compatibility mode compatible with the IE version, use the following code:
Specifies that the browser uses a specific document mode. The content can be separated by a comma (;) or separated by comma (,). It has nothing to do with the order of writing, the browser selects the highest supported version from the list to use the standard mode for rendering.
Another method is as follows:
In this way, 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 (Google embedded browser framework GCF ). This plug-in can keep your IE browser unchanged. However, when you browse the Web page, you actually use the Google Chrome browser kernel and support multiple Internet Explorer versions such as IE6, 7, and 8.