Conditional comment for "Except IE8"?
I use <!--[if IE 8]><![endif]--> to target IE8, but there are some JS that I want to download for all EXCEPT IE8 browsers, what conditional comment should I use?
Edit: I wonder if this will work: <!--[if lte IE 8]><![endif]-->
thanks
I can come up with a trick. Set the variable inside the IE conditional tag and include your JS code if this variable is not set.
<script> var ie8 = false; </script> <!--[if IE 8]> <script> ie8 = true; </script> <![endif]--> <script> if (ie8 == false) { // any code here will not be executed by IE 8 alert("Not IE 8!"); } </script> there are some JS I want to download for all EXCEPT IE8 browsers, which conditional comment should I use?
In order for something to appear in other browsers that do not support CC, you need the conditional comment below .
<!--[if !IE 8]><!--> .... <!--<![endif]--> (This is slightly different from the official Microsoft syntax, which is not valid HTML.)
"All browsers except IE8" are an unusual requirement, are you sure you want to? What about future versions of IE?
Try the negation, [if !IE 8] maybe?