html5shiv
2015-09-28 19:17
639 查看
https://github.com/hgonlywj/html5shiv
<!-–[if lt IE 9]--><script src=" http://html5shiv.googlecode.com/svn/trunk/html5.js "></script ><!--[endif]–- >
IE 无法渲染 HTML5 样式
http://intertwingly.net/blog/2008/01/22/Best-Standards-Support#c1201006277
Chris Wilson: If you (the page developer) really want the best standards support IE8 can give, you can get it by inserting a simple <meta> element. Aaron gives more details on this in his article.
Aaron Gustafson: This option, though strongly discouraged, will cause a site to target the latest IE browser versions as they release.
My basic problem is that I don’t know what features are in and out of IE8 or when it will be released. I don’t even have access to a simple screenshot.
I simply want to code to standards, and hope that Microsoft will keep up as best of their ability. Accordingly, I’ve implemented the following in my .htaccess file:
BrowserMatch MSIE best-standards-support
Header set X-UA-Compatible IE=edge env=best-standards-support
See also: loose coupling. https://en.wikipedia.org/wiki/Loose_coupling
HTML5 Shiv使用
html5.js 必须在页面head元素内调用(因为 IE 必须在元素解析前知道这个元素,所以这个 JS 文件不能在页面底部调用。)
作者已经把js文件放在Google code project上并允许大家直接调用:http://html5shiv.googlecode.com/svn/trunk/html5.js
可以使用IE条件注释来调用这个 JS 文件,这样像 FireFox, Safari 等非 IE 浏览器就会忽视这段代码,也就不会有无谓的 HTTP 请求了。下面这段代码仅会在IE浏览器下运行:
<!–[if IE]>
<script src=”http://html5shiv.googlecode.com/svn/trunk/html5.js”></script>
<![endif]–>
IE 对 HTML5 标签无法识别,所以无法渲染样式,有一种方法可以强制 IE 渲染 HTML5 标签,当你创建一个新的 DOM 元素(名字和它无法识别的标签相同)的时候,IE 就可以渲染,并且甚至无需插入这个元素,下面 flagLable
就能被渲染。
<!-–[if lt IE 9]--><script src=" http://html5shiv.googlecode.com/svn/trunk/html5.js "></script ><!--[endif]–- >
IE 无法渲染 HTML5 样式
http://intertwingly.net/blog/2008/01/22/Best-Standards-Support#c1201006277
Chris Wilson: If you (the page developer) really want the best standards support IE8 can give, you can get it by inserting a simple <meta> element. Aaron gives more details on this in his article.
Aaron Gustafson: This option, though strongly discouraged, will cause a site to target the latest IE browser versions as they release.
My basic problem is that I don’t know what features are in and out of IE8 or when it will be released. I don’t even have access to a simple screenshot.
I simply want to code to standards, and hope that Microsoft will keep up as best of their ability. Accordingly, I’ve implemented the following in my .htaccess file:
BrowserMatch MSIE best-standards-support
Header set X-UA-Compatible IE=edge env=best-standards-support
See also: loose coupling. https://en.wikipedia.org/wiki/Loose_coupling
HTML5 Shiv使用
html5.js 必须在页面head元素内调用(因为 IE 必须在元素解析前知道这个元素,所以这个 JS 文件不能在页面底部调用。)
作者已经把js文件放在Google code project上并允许大家直接调用:http://html5shiv.googlecode.com/svn/trunk/html5.js
可以使用IE条件注释来调用这个 JS 文件,这样像 FireFox, Safari 等非 IE 浏览器就会忽视这段代码,也就不会有无谓的 HTTP 请求了。下面这段代码仅会在IE浏览器下运行:
<!–[if IE]>
<script src=”http://html5shiv.googlecode.com/svn/trunk/html5.js”></script>
<![endif]–>
IE 对 HTML5 标签无法识别,所以无法渲染样式,有一种方法可以强制 IE 渲染 HTML5 标签,当你创建一个新的 DOM 元素(名字和它无法识别的标签相同)的时候,IE 就可以渲染,并且甚至无需插入这个元素,下面 flagLable
<html> <head> <style>falgLable { color: blue; }</style> <script>document.createElement("falgLable")</script> </head> <body> <falgLable>Hello world!</falgLable> </body> </html>
就能被渲染。
相关文章推荐
- [HTML5] HTML技巧100例
- HTML5服务器推送事件
- Html5离线缓存详细讲解
- Html5离线缓存详细讲解
- HTML5拖放本地资源
- HTML5拖放
- 【译】html5游戏入门
- Html5本地存储LocalStorage
- HTML5 Canvas使用路径——绘制圆形
- 从无到有(统计、请求、MVC、模块化)H5开发须知--一个完整的实例
- HTML5试题
- html5 Api 浏览器全屏使用心得
- HTML5开发培训课程
- HTML5 Local Storage 本地存储
- 文章标题
- html5 引入百度地图案例
- HTML5使用canvas绘制图形
- HTML5的canvas标签
- HTML5新增的元素和废除的元素
- HTML5的语法的改变