Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Only run script if not Internet Explorer

How would I go about running a script in every browser except for Internet Explorer?

I'm using queryloader2 on my site, and (for whatever reason) it takes around a minute to load in IE9, I'm assuming the same or worse in older versions of IE. In any other browser, it's just a few seconds. Due to this, I'd like to just not have the script run at all in any version of IE (it doesn't truly hurt the functionality of the site).

like image 763
chrscblls Avatar asked Jun 22 '12 12:06

chrscblls


1 Answers

You need to use conditional comments for that:

<!--[if !IE]>
    <script src="myScript.js" type="text/javascript"></script>
<![endif]-->
like image 183
antyrat Avatar answered Sep 20 '22 14:09

antyrat