很久之前,我们都是直接采用shiv来规避低版本浏览器不支持新语义化标签,
- 百度知道版本:
<!--[if lte IE 8]> <script> (function(){ 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]) } })(); </script> <![endif]-->
- 百度贴吧
<!--[if lt IE 9]> <script> (function(){ var tags = ['header','footer','figure','figcaption','details','summary','hgroup','nav','aside','article','section','mark','abbr','meter','output','progress','time','video','audio','canvas','dialog']; for(var i=tags.length - 1;i>-1;i--){ document.createElement(tags[i]);} })(); </script> <![endif]-->
个人想法:
部分活动项目其实tag用的不多就再狠一点,删掉点没有用的!