Hacker News new | ask | show | jobs
by spicyj 5724 days ago
This is a big annoyance of mine too. Reddit actually seems to have solved this problem, but I'm not sure how.
1 comments

I think they just generate code along with the page that uniquely selects an ad. Most sites just include some random javascript that asks the ad server to put an ad on the page.

Incidentally, while looking at the code Reddit sends, I noticed this gem:

    <script type="text/javascript">
    $(function() { 
        var ad = $("#ad-frame"); 
        if(ad.height() == 0 || ad.width() == 0) {
            $(".footer").append(
            "<img alt='' src='http://pixel.reddit.com/pixel/of_defenestration.png?hash=0e31bc319d5b5882b0cddf147f4ce1da5ac9c731&id=adblock&random=" + Math.random()*10000000000000000 + "'/>");
        } 
    });
    </script>
Of course, pixel.reddit.com is adblocked also, so this has no effect...