4

This question must be a duplicate, but I can't find the definitive answer on here.

How can I tell the browser not to load a script, if the browser is IE8 or below?

I know about targeting IE9 and above:

<!--[if gte IE 8]>
 According to the conditional comment this is IE 8 or higher<br />
<![endif]-->

but then the script does not load in non-IE browsers.

How can I say "load the script if not IE, or if IE and greater than IE8"?

Richard
  • 62,943
  • 126
  • 334
  • 542

1 Answers1

22

Conditional comment for 'Except IE8'?

<!--[if gte IE 9]><!-->
    // Your script here. This will only be loaded if IE version is greater than 8, OR any other browser.
<!--<![endif]-->

Should work?

Community
  • 1
  • 1
Abijeet Patro
  • 2,842
  • 4
  • 37
  • 64