How to comment on IE conditional comments?

I'm just wondering if it is possible to comment on IE conditional comments themselves (for testing purposes)? The following does not work:

<!-- <!--[if IE 7]> some code <![endif]--> -->

Thanks in advance! Flexx

+5
source share
6 answers

No, It is Immpossible.

SGML / HTML / XML / XHTML comments cannot be nested.

+5
source

I think you can just insert something to invalidate them:

<!--\[if IE 7]> some code <!\[endif]-->
+5
source
<!--[if IE 70]> some code <![endif]-->

:)

+3

, , Template Toolkit, , , .

Template Toolkit http://template-toolkit.org/

0

, .asp aspx, , , .

0

You cannot insert comments, but you can comment on them by adding an extra <!--to the beginning. Your example above varies from <!-- <!--[if IE 7]> some code <![endif]--> -->to <!-- <!--[if IE 7]> some code <![endif]-->. Just take out the excess -->, and he should comment on this disgusting conditional.

Tested successfully in Firefox 3.5.2 and IE 7.0.5730.13CO

0
source

All Articles