Not signed in (Sign In)

SkillShare - A place to discuss Web Standards and Web Design topics

Categories

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorhebel
    • CommentTimeMar 31st 2006
     permalink
    my whole website validated in XHTML and CSS, and then I added in the final code from statcounter, checked for a last time and counted about 8 errors.

    the offending code is:

    <!-- Start of StatCounter Code -->
    <script type="text/javascript" language="javascript">
    <!--
    var sc_project=324426;
    var sc_invisible=1;
    var sc_partition=1;
    var sc_security="";
    //-->
    </script>

    <script type="text/javascript" language="javascript" src="http://www.statcounter.com/counter/counter.js"></script><noscript><a href="http://www.statcounter.com/" target="_blank"><img src="http://c2.statcounter.com/counter.php?sc_project=324426&java=0&security=&invisible=1" alt="hit counter code" border="0"></a> </noscript>
    <!-- End of StatCounter Code -->

    would really appreciate any ideas.
    • CommentAuthorKanashii
    • CommentTimeMar 31st 2006 edited
     permalink
    Edit: Easier to show : )

    <script type="text/javascript">
    var sc_project=324426;
    var sc_invisible=1;
    var sc_partition=1;
    var sc_security="";
    </script>
    <script type="text/javascript" src="http://www.statcounter.com/counter/counter.js" />
    <noscript>
    <div>
    <a href="http://www.statcounter.com/"><img src="http://c2.statcounter.com/counter.php?sc_project=324426&java=0&security=&invisible=1" alt="hit counter code" /></a>
    </div>
    </noscript>

    There isn't really any need for the noscript section though. -shrugs- Up to you.
    • CommentAuthorhebel
    • CommentTimeMar 31st 2006
     permalink
    it partially worked - reduced the error to one:

    <script type="text/javascript">
    <!--
    var sc_project=324426;
    var sc_invisible=1;
    var sc_partition=1;
    var sc_security="";
    //-->
    </script>

    <script type="text/javascript" src="http://www.statcounter.com/counter/counter.js"></script><noscript><a href="http://www.statcounter.com/" target="_blank"><img src="http://c2.statcounter.com/counter.php?sc_project=324426&java=0&security=&invisible=1" alt="hit counter code" border="0"></a> </noscript>

    the last error is this:

    Error Line 154 column 302: end tag for "img" omitted, but OMITTAG NO was specified.
    ...alt="hit counter code" border="0"></a> </noscript>You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".
    • CommentAuthorKanashii
    • CommentTimeMar 31st 2006
     permalink
    <img src="" alt="" />
    • CommentAuthorhebel
    • CommentTimeMar 31st 2006
     permalink
    thanks for the help, Kanashii. the page validated with this final code:

    <script type="text/javascript">
    <!--
    var sc_project=324426;
    var sc_invisible=1;
    var sc_partition=1;
    var sc_security="";
    //-->
    </script>

    <script type="text/javascript" src="http://www.statcounter.com/counter/counter.js"></script>

    all I have to do now is upload it and see if it works on the web.
    •  
      CommentAuthornifkin
    • CommentTimeMar 31st 2006
     permalink
    There isn't really any need for the noscript section though. -shrugs- Up to you.

    Statcounter uses a remote image call which passes some variables in that noscript section to track visitors with JS disabled. You can cut it if you want, but those users with JS disabled (both of them) won't get tracked.
    • CommentAuthorhebel
    • CommentTimeMar 31st 2006
     permalink
    it would be useful to track all visitors since the website is for a small business and it's good to know which pages are most frequently visited. The problem is though that leaving in the no script causes the invalidation - for the reasons above. Any workarounds would be gratefully recieved.
    •  
      CommentAuthornifkin
    • CommentTimeMar 31st 2006
     permalink
    add a / at the end of the IMG tag in it. that's what's invalid, they're using an HTML4 IMG tag.
    • CommentAuthorhebel
    • CommentTimeApr 1st 2006
     permalink
    Thanks a lot Nifkin. It worked. My website is now validated 100%.

    I do have one last question though. It's about max-width. My website is liquid and above 1024x768 it stretches too wide in IE. The code I was using is:

    width: 93%;
    /* maximum width */
    max-width:950px;
    /* IE Dynamic Expression to set the width */
    width:expression(document.body.clientWidth > 950 ? "950px" : "auto" );

    although the code worked for IE, it didn't validate so I Ieft it out.

    It's not a huge problem as people with large screens can always resize their browsers but I was just wondering if you knew of a valid way to do this?
    • CommentAuthorKanashii
    • CommentTimeApr 1st 2006
     permalink
    In the head of the document:
    <!--[if lte IE6]>
    <style type="text/css">
    #content {
    width:expression(document.body.clientWidth > 950 ? "950px" : "auto" );
    }
    </style>
    <![endif]-->
    Or alternatively you can use conditional comment to link to an IE only stylesheet and put the rule in that. Be sure to position it after the main stylesheet though so it cascades properly : )
Add your comments
    Username Password
  • Format comments as (Help)