I thought I remembered reading somewhere that IE9 would not be supporting them, but now after searching I can't find any indication that this is true.
Is anyone aware of a definitive statement, either way, about whether Microsoft will be supporting conditional comments in IE9?
The Platform Preview supports them, fire it up (or download it, then fire it up) and see this example - http://jsbin.com/axaju3:
<!--[if IE 9]>
<p>You are using IE 9</p>
<![endif]-->
Tested in IE 9 Document Mode.
Straight from the horse's mouth, EricLaw from the IE team has confirmed in the comments below that CCs are still available in IE9.
A recent post on the IE blog shows that, as part of the effort to get consistent cross-browser HTML5 parsing, conditional comments will not work in IE10's rendering engine:
<!--[if IE]>
This content is ignored in IE10 and other browsers.
In older versions of IE it renders as part of the page.
<![endif]-->
This is true as of Platform Preview 2 and the author suggests you should use feature detection as an alternative.
Internet Explorer 9 will be the last version to support conditional comments. With the release of Internet Explorer 10, Microsoft is turning over a new leaf. According to the MSDN article on Conditional Comments:
Support for conditional comments has been removed in Windows Internet Explorer 10 Release Preview standards and quirks modes for improved interoperability and compliance with HTML5. This means that Conditional Comments are now treated as regular comments, just like in other browsers. This change can impact pages written exclusively for Windows Internet Explorer or pages that use browser sniffing to alter their behavior in Internet Explorer.
While this will not affect the majority of sites online, there's a chance it may affect yours. If it does, please consider making use of the x-ua-compatible meta tag or header to instruct Internet Explorer to Emulate Internet Explorer 9 (the last version to support conditional comments):
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9">
Note that this will prevent you from having access to the newest features of the browser, like broader support for HTML5, and CSS3, as well as more JavaScript APIs.
The best solution is to ween yourself off of conditional comments. With Internet Explorer 10, Microsoft's browser will begin to operate much the same way other popular browsers do, requiring less attention to writing IE-specific code, as well as removing the need for conditional comments altogether.
Conditional Comments aren't the only thing to become obsolete in IE10. There's more.
I believe it will have to, otherwise a huge amount of sites will break all at once and it's not in the best Microsoft's interests to make that sort of start for IE9.
If there is going to be some sort of compatibility mode, then it is possible conditional comments will be supported in this mode but not in "pure IE9".
P.S. Just speculations.
来源:https://stackoverflow.com/questions/3000465/will-ie9-support-conditional-comments