steve0nz
steve0nz

Reputation: 906

how can I stop certain javascript files from loading on internet explorer?

our website works fine on the latest ie10,firefox and chrome, however with ie9 below, certain js files have issues. I am aware of conditional scripts for IE but I would like to tell IE 9 and below not to load specific js files. How can I do so?

<!--[if lt IE 9 ]>
  <script src="/js/my_ie_script.js"></script>
<![endif]-->

Upvotes: 0

Views: 625

Answers (1)

Mataniko
Mataniko

Reputation: 2242

You're using Less Than IE 9 where you want Less Than Equal IE9:

<!--[if lte IE 9 ]>
     <script src="/js/my_ie_script.js"></script>
<![endif]-->

Note that your problematic JS will still load in IE, you should surround them with

<!--[if !IE]> -->
     <script src="/this/is/ok/to/load.js"></script>
<![endif]-->

Upvotes: 1

Related Questions