Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: Validating CCs

  1. #1
    New Coder
    Join Date
    Dec 2007
    Thanked 0 Times in 0 Posts

    Validating CCs

    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 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>
    <!--[if lt IE 7]>
    <a href="./forums/profile.php?mode=viewprofile&amp;u=6" >Eriom</a>

  • #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Sydney, Australia
    Thanked 649 Times in 639 Posts
    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.
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #3
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Halle (Saale), Germany
    Thanked 1,040 Times in 1,013 Posts
    Quote Originally Posted by felgall View Post
    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/lib...12.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/lib...spx#Validation


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts