Bun Wong's Blog

专注于 Web 应用程序开发

不同浏览器装载 Javascript 的 IE hack

看到 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]-->

000000

支持

鸡蛋

路过

雷人

我晕

好帅

留言 (1)

  • Joy Du

    March 4th 2009 • 15:52

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

发表留言

Google Analytics

最近一个月访问数:544