...

View Full Version : Validating CCs



JoshTrav
12-19-2007, 08:55 AM
Is there a way to validate conditional comments?

For example:


<![if (IE 7)|(!IE)]>
<div id="roster_officer_text_tank" style="position:absolute; top:1px; left:33px; width:125px; height:20px; padding-top:5px;" onmouseover="document.getElementById('roster_officer_image_tank').style.visibility = 'visible'" onmouseout="document.getElementById('roster_officer_image_tank').style.visibility = 'hidden'">
<a href="./forums/profile.php?mode=viewprofile&amp;u=6" >Eriom</a>
</div>

<div id="roster_officer_image_tank" style="position:absolute; top:1px; left:33px; width:125px; height:25px; visibility:hidden" onmouseover="document.getElementById('roster_officer_image_tank').style.visibility = 'visible'" onmouseout="document.getElementById('roster_officer_image_tank').style.visibility = 'hidden'">
<a href="./forums/profile.php?mode=viewprofile&amp;u=6" ><img src="images/roster/li_back_o.jpg" alt="" /></a>
</div>
<![endif]>
<!--[if lt IE 7]>
<a href="./forums/profile.php?mode=viewprofile&amp;u=6" >Eriom</a>
<![endif]-->

felgall
12-19-2007, 09:02 AM
As far as all programs except those from Microsoft, conditional comments are just comments. For Microsoft programs the program abbreviation IE, MSO, etc identifies the target program for the comment so that other Microsoft programs will ignore it.

As it is just comments as far as the standards are concerned it will just be validated as being a valid comment. If you want to test the individual conditional comments then open Microsoft Office or Internet Explorer or whichever the particular comment is targetted at and see what happens.

VIPStephan
12-19-2007, 09:07 AM
As far as all programs except those from Microsoft, conditional comments are just comments.

Be aware that the OP is using a “revealed comment” (as opposed to hidden) which is probably considered invalid HTML in browsers other than MS ones: http://msdn2.microsoft.com/en-us/library/ms537512.aspx#syntax

On the same page as I linked above is an explanation on how to “make” it valid: http://msdn2.microsoft.com/en-us/library/ms537512.aspx#Validation



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum