ie兼容總結javascript
一、頁面必須編寫規範html
二、頁面須要添加html5
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"/>
大體意思是谷歌對ie作的兼容java
三、引入如下的js文件chrome
<script> var ie_script=function(src){ return "\<script type\=\"text/javascript\" src\=\""+src+"\"\>\<\/script\>"; }; if(!document.addEventListener){ document.write(ie_script('http://192.168.77.28:8089/EMS/shanlv/IE8/es5/es5-shim.min.js')); document.write(ie_script('http://192.168.77.28:8089/EMS/shanlv/IE8/html5/dist/html5shiv.min.js')); document.write(ie_script('http://192.168.77.28:8089/EMS/shanlv/IE8/Respond/dest/respond.min.js')); document.write(ie_script('http://192.168.77.28:8089/EMS/shanlv/IE8/pie/PIE.js')); } </script>
若是是bootstrap 頁面在寫柵格的時候必須寫完整,特別是col-xs-3,不寫的會出現換行,寬度不一致,由於ie會默認按照窄屏的方式渲染bootstrap