IE7 Blocks Adsense and YPN - and an Easy Fix!

I've noticed with IE7 BETA 2, that at least some of the time, IE7 blocks Google adsense and Yahoo Publisher network ads from showing. If you do a search on "IE7 blocks adsense" you will see that I have no shortage of company in the complaint department!

This could, of course, be really problematic as IE7 is going to be in wide use in a matter of months. The bad thing about it is that there is NO USER PROMPT offering the user an opportunity to "Yes, I want to see the ads". Nothing - the ads simply don't show up at all!

However this turns eventually out, there is a very easy fix for this:

The basic problem here is that the tightened (and hopefully, perhaps not quite finalized) security setup in IE7 prevents cross-site loading of javascript. You can put the source site of the javascript into your trusted sites list, but that solution would rely 100% on the actions of the user, which is completely unacceptable.

So what you do instead is download the adsense or YPN javascript file that the typical ad code references, simply deposit it on your webserver, and change your ad code's src property to point to the exact copy that you've stored on your own domain.

Here is a sample that's been fixed this way, with a sample YPN ad on it:


If you have noticed this problem with IE7 BETA 2 and the above page shows an ad when you click the link, then you know that this fix works.

Presto! No more cross-site javascript; you haven't altered their script in any way (so I hope it would not be a TOS violation) and IE7 is as happy as a pig in mud. This solution should probably work with FireFox and other browsers as well, although I haven't seen any comments about FireFox exhibiting this behavior.

I'd be interested in reading some comments from other developers who have run into this issue.

BTW, if you are tired of typing g-o-o-g-l-e to get to your favorite search engine, why not try one of the other domains they own, all of which point to their main site?

Here's a nice short one: http://ghut.org/