不要在IE6或更低版本中加载脚本

Ale*_*lex 4 html javascript internet-explorer conditional-comments

如何添加条件,以便用户运行IE6或更少时不加载某些javascript.我尝试了以下内容,并且<script>不会在任何浏览器中加载:

<!--[if gt IE 6]>
<script blah blah blah... />
<![endif]-->

<!--[if ! IE 6]>
<script blah blah blah... />
<![endif]-->

<!--[if !IE 6]>
<script blah blah blah... />
<![endif]-->
Run Code Online (Sandbox Code Playgroud)

一些援助将不胜感激.

Bol*_*ock 10

试试这个:

<!--[if gt IE 6]><!-->
<script blah blah blah... />
<!--<![endif]-->
Run Code Online (Sandbox Code Playgroud)

上面的语法(带有额外的注释分隔符)在本文中进行了解释.