如果IE >= 9或不IE的条件指令
Conditional directives for if IE >= 9 or not IE
我正在开始一个新项目,遗憾的是我必须支持IE7 &IE9。最终,我将能够移除对IE7的支持,但希望能以一种平稳的方式移除它。
本质上,我希望尽可能使用最新版本的库。
<!--[if lt IE 9]>
<script src="https://raw.githubusercontent.com/aFarkas/html5shiv/master/dist/html5shiv.min.js"></script>
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<![endif]-->
<!--[if gte IE 9]>
<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
<![endif]-->
<!--[if !IE]><!-->
<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
<!--<![endif]-->
<!--[if lt IE 8]>
<script src="http://cdnjs.cloudflare.com/ajax/libs/json3/3.3.1/json3.min.js"></script>
<![endif]-->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.17/angular.min.js"></script>
<!--[if lt IE 9]>
<script src="local/angularjs-attribute-polyfill.js"></script>
<![endif]-->
正如你所看到的,我有两次JQuery库,一次是IE9,一次是不等于其他浏览器的IE…有什么好的方法来巩固这些吗?
可以使用
<!--[if gte IE 9]><!-->
<script src="...jquery-2.1.1.min.js"></script>
<!--<![endif]-->
如果使用IE9或更高版本,此条件注释将允许包含脚本…而非ie浏览器无论如何都会忽略注释,只包含脚本,不问任何问题。
相关文章:
- Iframe加载调整大小在Chrome中工作,但不能在IE或Firefox中工作
- window.dispatchEvent 在 Firefox、Safari 或 IE 中不起作用
- 动态关键帧插入在 IE 或 Firefox 上不起作用
- JavaScript滚动图片库在Chrome或IE中不起作用
- 在Chrome中点击两次,而不是IE或Firefox
- IE 0.width为null或不是对象
- innerHTML=Date()在fiddle中工作,但在Chrome或IE中不工作
- spyOn(Date, 'now') 在 Firefox 或 IE 中不起作用
- JavaScript 确认在 Chrome 或 IE 中不起作用,但在 Firefox 中工作
- Javascript 对象在 IE 中为 null 或不是 object
- CSS3 动画在 Safari 或 IE 中不起作用
- Javascript 倒数计时器在 Safari 或 IE 上不起作用
- 受信任站点 WinXP IE 8 的错误“window.opener.top 为空或不是对象”
- Jquery Hover 在 Firefox 或 IE 中不起作用
- Javascript在Chrome中工作,但在IE或Firefox中不起作用
- document.head.appendChild 或 document.createElement 在 IE 中不起作
- IE 8中的jQuery错误:消息:'this.0.ownerDocument.body'为null或不
- jQuery Find()在Firefox或IE中不起作用
- 'arrpf[i][1]'为空或不是对象IE 8
- stopPropagation在Firefox中工作,但不能在IE或Chrome中工作