Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Markup validation error

Options
  • 26-01-2010 5:35am
    #1
    Registered Users Posts: 3,803 ✭✭✭


    Hey, I'm new to this web dev stuff so bare with me :D

    I've recently started validating my site using the W3C validator.

    I have allot of errors, as you can see :Dvalidation errors

    I'm kinda confused by some of these errors, but the one thats confused me most is this one:
    XML Parsing Error: EntityRef: expecting ';'

    This occurs allot (near the end of the list of errors) and seems to be related to href link.

    the line of code thats causing the problem it says is:

    [HTML]<a href="index.php?controller=photos&view=show&category=82&album=384&photo=21936&sort_by=1">[/HTML]

    Can anybody see what is wrong with the link? it seems fine to me.

    Thanks for your help


Comments

  • Closed Accounts Posts: 7,145 ✭✭✭DonkeyStyle \o/


    Wow, does that link even work? I'd leave those &amps; as & when it comes to URLs.


  • Registered Users Posts: 3,803 ✭✭✭Benzino


    Wow, does that link even work? I'd leave those &amps; as & when it comes to URLs.

    Yeah it does work, I had them as & originally but then it complained about it so I changed it to get rid of the errors, the links work fine on Safari, FF, IE and Chrome. Haven't checked on other browsers.


  • Closed Accounts Posts: 7,145 ✭✭✭DonkeyStyle \o/


    I think your IE conditionals could be the problem.
    According to this, you should change the way you do your html comments
    http://www.codedread.com/blog/archives/2007/04/17/how-to-use-ie-conditional-comments-in-xhtml/


  • Registered Users Posts: 3,803 ✭✭✭Benzino


    I think your IE conditionals could be the problem.
    According to this, you should change the way you do your html comments
    http://www.codedread.com/blog/archives/2007/04/17/how-to-use-ie-conditional-comments-in-xhtml/

    That was another error I wasn't quite sure how to fix, thanks for the link, it removed those errors relating to the conditionals.

    Still can't figure out what it is complaining about in the links tho :(


  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    This belongs in the design forum really.


  • Advertisement
  • Moderators, Computer Games Moderators Posts: 10,462 Mod ✭✭✭✭Axwell


    Post the code here so we can have a look. Particularly the few lines before the link as it could be expecting a ; on the line before the link.


  • Registered Users Posts: 3,803 ✭✭✭Benzino


    Axwell wrote: »
    Post the code here so we can have a look. Particularly the few lines before the link as it could be expecting a ; on the line before the link.

    Here is the code, beforehand I get info from a database (30 items in total) so I can loop through the array and display the photos.

    [PHP]<?php
    foreach ($latest_photos as $site_preview_photo) {

    if ($count % 8 == 1) {
    echo "<ul id='image-collage-list'>";
    }
    ?>

    <li class="image-collage-item"><a href="index.php?controller=photos&view=show&category=<?php echo $latest_album[0]; ?>&album=<?php echo $site_preview_photo; ?>&photo=<?php echo $site_preview_photo; ?>&sort_by=1;" class='screenshot' rel='<?php echo $site_preview_photo.'large/'.$site_preview_photo; ?>' ><img src='<?php echo $site_preview_photo.'tiny/'.$site_preview_photo; ?>' alt='PascalsPics' /></a></li>

    <?php

    if ($count % 8 == 0 || ($count - 1) == count($latest_photos) ) {
    echo "</ul>";
    }

    $count++;
    }[/PHP]


  • Registered Users Posts: 6,511 ✭✭✭daymobrew


    FYI: In the middle of the 'li' line you change from double to single quotes. It makes it hard to figure out where strings start and end.
    For a long line like that I sometimes use sprintf so that the output string (in the code) is easier to read.


  • Moderators, Science, Health & Environment Moderators Posts: 8,956 Mod ✭✭✭✭mewso


    Your javascript comments seem to be invalid. Always a good idea to put your script in an external file where possible anyway.
    You are putting block elements in span elements.
    You are correctly using & in links instead of & but not everywhere. In some cases one instance of & is causing a lot of errors - "Aideen_&_Brian" in the rel attribute (try Aideen_&_Brian).
    Single quotes, double quotes and some not closed for attributes - try and stick to one method and make sure they are all closed. My preference would be double quote on attributes.

    Anyway when validating always fix the simple and obvious errors before you even begin to wonder about the less obvious one as you'll often find them gone when you fix everything else. There are so many knock on errors caused by errors earlier in the html.


  • Registered Users Posts: 3,803 ✭✭✭Benzino


    I dunno why I switched to single quotes there, silly thing to do :(

    Thanks for the help :)


  • Advertisement
Advertisement