Curious. What's the difference between these two conditional comments?
<!--[if gte IE 8 | !IE]><!-->
<!--[if (gte IE 8) | !(IE)]><!-->
The Sitepoint reference entry lists parentheses as a "subexpression operator". But today I've seen both of the above versions used and on my own site, I use the first version. Is it right/wrong or does it matter?
In that particular case since only IE reads conditional comments in the first place, the !IE is just a comment to remind you that the condition also applies to all other browsers.
Yes, but what about the parentheses?
I know they're not needed if you aren't using the | or in there... but with the OR you'd think it was safer. I'd check the MSDN pages regarding CC's to be sure. It's possible they are necessary when using | and it just looks like it's working because the !IE thing makes no sense... only IE would read the "not IE" comment, so no not-IE browsers will see that.
<!--[if gte IE 8]> stuff for browsers IE8 and IE9... IE10 does not do CCs<!-->
I would think the parens would work like this anyway:
<!--[if (gte IE 8 | IE 6)]> stuff for browsers IE8 and IE9... and IE6 (so, skipping IE7)<!-->
This topic is now closed. New replies are no longer allowed.