六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 116|回复: 0

让所有IE支持HTML5的解决方案

[复制链接]

升级  5.33%

12

主题

12

主题

12

主题

秀才

Rank: 2

积分
58
 楼主| 发表于 2013-1-24 06:49:11 | 显示全部楼层 |阅读模式
Since HTML5 is getting more attention by way of marking up our new pages, and the only way to get IE to acknowledge the new elements, such as <article>, is to use the HTML5 shiv, I've quickly put together a mini script that enables all the new elements.


Usage & Download
The html5.js and must be inserted in the head element (this is because IE needs to know about the element before it comes to render them - so it can't sit in the footer of the page, i.e. below the elements in question).

I've now moved HTML5 shiv to be hosted on a Google code project with the correct mime type being served, so if you're happy with the extra HTTP request, you can hot link the script: http://html5shim.googlecode.com/svn/trunk/html5.js
It's conditional within the code, so Firefox et al won't run the code - but it doesn't hurt to wrap it in an IE conditional call to reduce the http pulls for other browsers:

<!--[if IE]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表