How come there are no valid HTML/CSS using ad services yet?

Discussion in 'Generating Revenue' started by cheat_master30, Apr 28, 2012.

  1. cheat_master30

    cheat_master30 Fanatic

    Seriously, what's with all the use of outdated crap like iframes and badly done javascript in most ad code?

    Shouldn't some ad network have come up with a validly coded system yet, it's not like it's impossible to measure ad impressions/clicks in a way that passes validation, right?
  2. Nutt

    Nutt Coder/Designer

    Do iframes not validate? Guess I've never tried.

    A couple thoughts.

    1 - By being in an iframe, it's loading directly from their domain which lets them do things with cookies that aren't allowed cross domain.

    Ex: I visit Amazon and they store a cookie that identifies me. I then buy something that's tied to that identification. Tomorrow I visit a site that uses one of the Amazon affiliate widgets. Because it's loading from that page has access to my cookie, and can use that to try and sell me a lime green widget because I bought a forest green widget yesterday.

    2 - Putting the ad in a fixed sized iframe allows the page to load, even if the ad itself is slow.

    Let's say that you're embedding Adsense, and the way to do it is to <?php include(''); ?>. goes down. Your page would hang until your server gives up trying to load the remote file.
  3. cheat_master30

    cheat_master30 Fanatic

    No, iframes don't validate. But in newer browsers, you can just use the object tag in the same way as an iframe, at least in XHTML. Iframes might work in HTML 5 though.

    Either way, no technical reason that stops them from loading content direct from their servers at all.

    And it's bizarre how much ad code uses invalid javascript when you could probably do the exact same thing with valid code.
Draft saved Draft deleted