作者 : Bun Wong
日期 : 2009年03月03日
浏览 : 959 次
评论 : 1 个
http://www.hdwong.com/article/25/

不同浏览器装载 Javascript 的 IE hack

技术交流 @ 2009年03月03日 收藏&分享

看到 PNP广州 群里的 arlex 提到的,挺经典,就记下来:

<!--[if !IE]><!--> 除IE外都可识别 <!--<![endif]-->

<!--[if IE]> 所有的IE可识别 <![endif]-->

<!--[if IE 5.0]> 只有IE5.0可以识别 <![endif]-->

<!--[if IE 5]> 仅IE5.0与IE5.5可以识别 <![endif]-->

<!--[if gt IE 5.0]> IE5.0以及IE5.0以上版本都可以识别 <![endif]-->

<!--[if IE 6]> 仅IE6可识别 <![endif]-->

<!--[if lt IE 6]> IE6以及IE6以下版本可识别 <![endif]-->

<!--[if gte IE 6]> IE6以及IE6以上版本可识别 <![endif]-->

<!--[if IE 7]> 仅IE7可识别 <![endif]-->

<!--[if lt IE 7]> IE7以及IE7以下版本可识别 <![endif]-->

<!--[if gte IE 7]> IE7以及IE7以上版本可识别 <![endif]-->

评论 (1)

  • #1. Joy Du

    2009年03月04日

    这是IE中的条件注释,对IE的版本及是否为IE有很好的区分能力。

* 昵称:

* 评论:

* 验证码: (请输入下图的 4 位数字)

Captcha看不请, 换一张

© 2011 Bun Wong

本博客基于 Bun PHP Framework 构建 • 粤ICP备07036370号