How not to load a script in IE?

Daniel J F picture Daniel J F · Mar 31, 2011 · Viewed 19.9k times · Source

It's possible to load a script only in IE with conditional comments

<!--[if lte IE 7]>
    <script type="text/javascript" src="somescript.js"></script>
<![endif]-->

but what if I don't want to load it in IE lte 7 (but still need it in all other browsers)?

Any simple solutions?

P.S. I have a problem with SyntaxHighlighter - too many code slows IE7 down and since I'm short of time, I decided just to turn it off in IE7 for now.

Answer

Bala R picture Bala R · Mar 31, 2011

This post says you can use the ! (NOT) operator like [if !IE]