Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Don't load script in IE6 or less

How can I add a condition so that if a user is running IE6 or less not to load some javascript. I've tried the following, and the <script> doesn't load in any browser:

<!--[if gt IE 6]>
<script blah blah blah... />
<![endif]-->

<!--[if ! IE 6]>
<script blah blah blah... />
<![endif]-->

<!--[if !IE 6]>
<script blah blah blah... />
<![endif]-->

Some assistance would be much appreciated.

like image 204
Alex Avatar asked Dec 06 '22 20:12

Alex


1 Answers

Try this:

<!--[if gt IE 6]><!-->
<script blah blah blah... />
<!--<![endif]-->

The above syntax (with the extra comment delimiters) is explained in this post.

like image 197
BoltClock Avatar answered Dec 10 '22 12:12

BoltClock