IE6 IE7 IE8 IE9 compatibility problem Ultimate Solution

Source: Internet
Author: User

put down the burden and solve the problem of low version compatibility
This is a commonplace problem, the natural solution to this problem is also more, the following a number of solutions: 1. Force the use of the high version rendering mode. Force the use of Edge mode to parse page code
<meta http-equiv= "x-ua-compatible" content= "Ie=edge" >
Force the Chrome browser kernel (if installed)
<meta http-equiv= "x-ua-compatible" content= "ie=edge,chrome=1″/>
issue: There will still be some low-version users that cannot render properly. The palliative does not cure. 2.CSS hack different code condition annotations for different browsers, which are often used.
<!--[if IE 6]>coding...<! [endif]-->//ie6<!--[if LTE IE 9]>coding...<! [endif]-->//less than or equal to IE9
Attribute prefixes, many of which are not listed.
_background-color: #000;//ie6*background-color: #000;//ie6 IE7
to solve some problems, you cannot use the new features of the browser. Generally applies to less complex pages. 3.JS/CSS compatible plugins Here are some examples of commonly used
Html5shiv: Makes the browser compatible with HTML5 tag syntax. respond: A fast & Lightweight Polyfill for min/max-width CSS3 Media Queries (for IE 6-8, and more) bsie : Support for most bootstrap features on IE6. ie-css3/pie: Enables ie6-9 to support CSS3.
Load the appropriate plugin for the lower version of the browser using the above hack method.can solve most of the compatibility problems. Additional loading of the Js/css file is required. 4. The Ultimate solution: Low version prompts for upgrade.
determine the browser version, the lower version of the browser prompts to upgrade, or force jump to the upgrade page.
Why to force prompting for upgrade reason: 1. The lower version of the browser share is already small, decreasing. Baidu Statistics 2016 data: IE6 2.2%;ie7 4.4%;ie8 17.06%;ie9 5.58%. ie down Trend chartOperating System: Win XP gradual fade out (IE6), win 10 users more and more (using Edge) 2. Microsoft has completely abandoned the IE brand, pushing edge. 3. Waste a lot of time and effort in order to be compatible with low-version browsers. 4.HTML5 new features are not available. 5. If you are reading this article, you should also list some. Discard the low-version browser user and force the upgrade. Provide JS code:Tip of page head:
//The following code is placed in the page or JS file can be(function(W) {if(! ("WebSocket"inchw&&2===w.websocket.closing)) {varD=document.createelement ("div");d. Classname= "Browsehappy";d. innerhtml= ' <div style= ' width:100%;height:100px; Font-size:20px;line-height:100px;text-align:center;background-color: #E90D24; color: #fff; margin-bottom:40px; " >\u4f60\u7684\u6d4f\u89c8\u5668\u5b9e\u5728<strong>\u592a\u592a\u65e7\u4e86</strong>\uff0c\ U592a\u592a\u65e7\u4e86 <a target= "_blank" href= "http://browsehappy.osfipin.com/" style= "background-color:# 31b0d5;border-color: #269abc; text-decoration:none;padding:6px 12px;background-image:none;border:1px Solid Transparent;border-radius:4px;color: #FFEB3B; " >\u7acb\u5373\u5347\u7ea7</a></div> ';varf=function(){varS=document.getelementsbytagname ("Body") [0];if("undefined" = =typeof(s)) {setTimeout (f,10)}Else{S.insertbefore (D,s.firstchild)}}; f ()}} (window));

Direct Jump

// either on the page or in the JS file (function(w) {if(! (" WebSocket " in W&&2===w.websocket.closing)" {w.location.replace ("http://browsehappy.osfipin.com/") );}} (window));

You can also use conditional annotations as a way to place them in an HTML page.

IE6 IE7 IE8 IE9 compatibility problem Ultimate Solution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.