SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict bsmbahamas's Avatar
    Join Date
    Sep 2008
    0 Post(s)
    0 Thread(s)

    validation question

    hi guys i've been coding for like 12 years or so, and finally took the plunge into creating css based layouts rahter than tables and after many months of studying i re-designed my site today and validated it via validator_w3_org and finally got a pass.

    but here's the thing - i use php includes to dynamically rotate banner hosting code from a few banner exchanges so i earn banner impressions in multiple banner exchanges but only display one at a time on my site.

    i've noticed that my site fails when the banners load, i'm using 2 exchanges and they each generate 2 seperate amount of errors.

    since i'm including them and they are not hard-coded into my page does it matter that my site doesn't validate when i include them?

    i.e. is it better not to include them since they make my site stop validating?

    i'll probably leave them running as they help me advertise my site and my site validates if they are left out.

    what are your thoughts on this matter?

    keep the 'widgets' or remove them?

    i can easily run my own ads that would validate, but i'd lose out
    on having my banners display on those networks.

    thanks for responding.

  2. #2
    SitePoint Member
    Join Date
    Dec 2008
    0 Post(s)
    0 Thread(s)
    One popular trick for conforming pages that want to run non-conforming ads (IIRC - Google AdSense doesn't validate and still uses tables), is to have the ad imported using an embedded object. For example,

    <object data="/href_of_your_ads" type="text/html" width="468" height="60" />

    This way you cleanly separate for the browse the non-conforming content from the conforming content. And, this should overall give you much better rendering behavior and (hopefully) fix the problem with the page 'failing' when the banner loads.

    For more on using <object /> to embed ads, google:

    "Adding AdSense to application/xhtml+xml pages"

    I'd give you a direct link, but apparently I don't have enough posts here to be able to submit links.

    Best of luck.
    Applied Stacks - New 'Powered By' wiki for all languages,
    libraries, and web frameworks.

  3. #3
    SitePoint Enthusiast
    Join Date
    Nov 2008
    0 Post(s)
    0 Thread(s)
    You can probably answer your own question if you consider why you are validating your pages in the first place. For example, I validate to find errors in my code. If I really needed to use some invalid code, I could, because I'd know the source of my validation errors, and I could ignore them. However, others use validation as a mark of professionalism. If that's important to you, then you'll need to find a solution that uses only valid code (you could try danielcer's suggestion above).


Posting Permissions

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