My site isn't valid HTML because of affiliate banner

Discussion in 'HTML & Website Design' started by Kat2, Apr 13, 2007.

  1. #1
    According to the W3C validator (http://validator.w3.org/) my site isn't valid, because of some affiliate code.

    The code looks like this:

    <a href="http://www.myreferer.com/mydb/?M=decalgirl&amp;ID=Rainbow7180&amp;L=1" target="_BLANK"><img src="http://www.decalgirl.com/graphics/banner-1.gif" alt="Console skins at DecalGirl" border="0" height="60" width="468"></a>
    Code (markup):
    And the validator has trouble with the ID and the L after my username - here are the error messages I get:

    Warning Line 136 column 180: cannot generate system identifier for general entity "ID".
    Error Line 136 column 180: general entity "ID" not defined and no default entity.
    Error Line 136 column 182: reference to entity "ID" for which no system identifier could be generated.

    The link works fine by itself and the page looks fine in Firefox and IE (don't have Opera) - so should I worry that my page doesn't validate because of that link, or is it not a big deal?
     
    Kat2, Apr 13, 2007 IP
  2. the_pm

    the_pm Peon

    Messages:
    332
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    0
    #2
    There's no reason for those errors. These appear to be bugs in the W3C validator. I tested that line in the HTML Help validator (and much more accurate instrument), and it correctly bypasses those elements, recognizing the semi-colons as part of a URL.

    You'd throw a couple errors if you were trying to validate to a script docype (HTML 4.01 Strict, XHTML 1.0 Strict or HTML 1.1), but if you'd using a transitional doctype, this bit of code is perfectly clean.
     
    the_pm, Apr 13, 2007 IP
  3. bacanze

    bacanze Peon

    Messages:
    2,419
    Likes Received:
    127
    Best Answers:
    0
    Trophy Points:
    0
    #3
    As mentioned, its just the format of the URL characters, I wouldnt worry about it too much.
     
    bacanze, Apr 14, 2007 IP
  4. iatbm

    iatbm Prominent Member

    Messages:
    5,151
    Likes Received:
    352
    Best Answers:
    0
    Trophy Points:
    360
    #4
    If you use xhtml then target="_blank" will not validate !

    Show us the site so we can take a look !
     
    iatbm, Apr 14, 2007 IP
  5. rlineker

    rlineker Well-Known Member

    Messages:
    1,534
    Likes Received:
    172
    Best Answers:
    0
    Trophy Points:
    160
    #5
    <img src="http://www.decalgirl.com/graphics/banner-1.gif" alt="Console skins at DecalGirl" border="0" height="60" width="468">
    Code (markup):
    Should be
    <img src="http://www.decalgirl.com/graphics/banner-1.gif" alt="Console skins at DecalGirl" border="0" height="60" width="468" />
    Code (markup):
     
    rlineker, Apr 14, 2007 IP
  6. Rich_H

    Rich_H Peon

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    That's not what I found when I checked out your site. The ampersands in your affiliate URIs are not specified as &amp;

    Those errors are telling you that there are no html entities for &ID and &L which is what is actually in the uri because the ampersands (&) aren't converted to &amp;





    No it shouldn't


    Rich
     
    Rich_H, Apr 14, 2007 IP
  7. Kat2

    Kat2 Well-Known Member

    Messages:
    143
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    108
    #7
    The index page is http://www.consolecolors.com/index.html and the affilliate banner is at the bottom.

    Sorry about the ampersands, I pulled the code from View Source instead of from the HTML itself. I didn't realize it would render differently.

    <A HREF="http://www.myreferer.com/mydb/?M=decalgirl&ID=Rainbow7180&L=1" TARGET="_BLANK"><img src="http://www.decalgirl.com/graphics/banner-1.gif" border="0" WIDTH="468" HEIGHT="60" ALT="Console skins at DecalGirl"></A>
    Code (markup):
    It is HTML 4.01 transitional.

    Thanks for the info, the_pm, I'll look for that online.
     
    Kat2, Apr 14, 2007 IP
  8. bscdesign.com

    bscdesign.com Active Member

    Messages:
    681
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    58
    #8
    Rich_H got it. I was thinking that it had to be the &'s. Change every "&" symbol in the link to "&amp;". It will work then.

    Any time you have a problem with validation due to entities open up the HTML file on you computer (Not Browser souce code) and do a search (CTRL+F for Windows) for "&" within the document. Anywhere you find an "&" without a semi-colon anywhere near it it is invalid code.
     
    bscdesign.com, Apr 15, 2007 IP
  9. Kat2

    Kat2 Well-Known Member

    Messages:
    143
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    108
    #9
    Oooh, gotcha, thanks!! I noticed their code isn't optimized... it doesn't provide the width and height... had to do it myself.
     
    Kat2, Apr 15, 2007 IP
  10. the_pm

    the_pm Peon

    Messages:
    332
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    0
    #10
    the_pm, Apr 15, 2007 IP
  11. OoteR

    OoteR Peon

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    I dont know why you care about the w3c standards honestly. Check how it looks in 10+ browsers and move on with your life, the w3c stuff wont make your css work in IE half the time..
     
    OoteR, Apr 15, 2007 IP
  12. Kat2

    Kat2 Well-Known Member

    Messages:
    143
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    108
    #12
    I just want it to work in as many browsers as possible.
     
    Kat2, Apr 15, 2007 IP
  13. the_pm

    the_pm Peon

    Messages:
    332
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    0
    #13
    That logic is about as flawed as a housebuilder saying "I don't know why you bother with building codes - if it stands, it's fine."
     
    the_pm, Apr 15, 2007 IP