Have been trying to fix this for the past hour.
Here goes:
<script type="text/javascript">
function openAd(adType, urlToGo) {
pageTracker._trackPageview(adType);
window.open(urlToGo, '_blank');
return false;
}
</script>
Anyone have any idea why this doesn't work?
Called it like onclick="openAd('/Ads/MMA_Front_Page.com', 'http://www.anrdoezrs.net/click-4706163-10919130');"
I uploaded a live version at:
2 Answers 2
I have went to your page in Opera 11.60 and called openAd('/Ads/MMA_Front_Page.com', 'http://www.anrdoezrs.net/click-4706163-10919130'); through Dragonfly and the information was displayed in my browser that the popup has been blocked. When I click to display the popup anyway, the new windows with your add target is displayed correctly.
Thus, I would suggest to seek different method to open the ad or accept the fact you may be blocked by popup / ad blocker.
3 Comments
if your problem is that the browser loads the url in the href as well as opens a new window then you need to add return false as so:
onclick="openAd('/Ads/MMA_Front_Page.com', 'http://www.anrdoezrs.net/click-4706163-10919130'); return false;"
openAd, which you can do in firebug or with the debugger statement. Make sure that the built-in pop-up blocker and no extension (e.g. any adblocker) is preventing the new window or tab from opening.