1. 程式人生 > >ie8 支援html5 標籤及ie8 中jQ版本相容性問題

ie8 支援html5 標籤及ie8 中jQ版本相容性問題

  i8 不支援jq2.0以上的版本
可以支援2.0以下的版本
( 可以支援<script type="text/javascript" src="js/jquery-1.11.0.js" ></script>)

ie8 css  hack
http://www.cnblogs.com/top5/archive/2009/11/24/1609784.html

判斷瀏覽器並對ie8版本進行升級提示
將以下程式碼載入<head></head>標籤內 <!--[if IE 8]>
        <script>
            var DEFAULT_VERSION = "8.0";
            var ua = navigator.userAgent.toLowerCase();
            var isIE = ua.indexOf("msie")>-1;
            var safariVersion;
            if(isIE){
                   safariVersion =  ua.match(/msie ([\d.]+)/)[1];
            }
            if(safariVersion <= DEFAULT_VERSION ){
                alert("Your browser version is too low, please upgrade your browser");
            }
        </script>
        <![endif]-->
i8支援html5 頁面中需加入以下程式碼
css程式碼 <style>
article,aside,dialog,footer,header,section,footer,nav,figure,menu{display:block;} 
</style>
js程式碼 <script> (function() {  
     if (!  
     /*@
[email protected]
*/  
     0) return;  
     var e = "abbr, article, aside, audio, canvas, datalist, details, dialog, eventsource, figure, footer, header, hgroup, mark, menu, meter, nav, output, progress, section, time, video".split(', ');  
     var i= e.length;  
     while (i--){  
         document.createElement(e[i]);  
     }  
})()   
</script>