user1706680
user1706680

Reputation: 1111

Target everything but IE 9

Is there a way to only prevent IE 9 from loading a stylesheet or script?

I just found a way to prevent all IE versions from doing something but not a certain version:

<!--[if !IE]><!-->
    <link rel="stylesheet" href="not-ie.css" />
    <script src="not-ie.js"></script>
<!--<![endif]-->

Upvotes: 0

Views: 63

Answers (1)

BoltClock
BoltClock

Reputation: 723729

Sure, just specify the version:

<!--[if !(IE 9)]><!-->
    <link rel="stylesheet" href="not-ie-9.css" />
    <script src="not-ie-9.js"></script>
<!--<![endif]-->

Note that what you currently have will result in IE10 and later loading your resources like other browsers, as those newer versions do not process conditional comments.

Upvotes: 2

Related Questions