點評:讓所有IE支持HTML5的解決方案.
自從HTML5能為我們的新網頁帶來更高效潔凈的代碼而得到更多的關注,然而唯一能讓IE識別那些新元素(如<article>)的途徑是使用HTML5 shiv,感謝remy sharp為我們提供了這個迷你腳本來解決IE支持HTML5的問題。復制代碼
代碼如下:
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
復制代碼
代碼如下:
(function(){if(!/*@cc_on!@*/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(','),i=e.length;while(i--){document.createElement(e[i])}})()
新聞熱點
疑難解答