I just heard that Internet Explorer 7 has adblock plug-in. The adblock plug-in is a utility for internet to block ads (including adsense), so when the visitor visit the sites, the ads wont display. Thus, the less ads when visitor visiting sites, the more visitor will enjoy the sites. But then again, Can webmaster really leave without ads? I bet is not.

so here is some script to block ad-block, this script is going to detect the adblock, if its used on browser or not. If it detects adblock, the script will prompt visitor with this text “Sorry this page cannot be displayed because adblocking software has been detected”. That way we are hoping visitor could turn of the adblock plug-in, and continue visit the site.

ok then here is the script : (put it on your html page, were your put your ads is)

<script>

function blockedads()

{

var giframe = document.getElementsByTagName(”iframe”);

var bod = document.getElementsByTagName(”body”);

var blocked=1;

for (var i = 0; i < giframe.length; i++)

{

var name = giframe[i].getAttribute(”name”);

if(name == “google_ads_frame”)

{

var blocked=0;

}

}

if(blocked)

{

bod[0].innerHTML = ‘<br> <br>Sorry this page cannot be displayed because
adblocking software has been detected’;}

}

setTimeout(’blockedads()’, 4000);

</script>

I found this over here. hope its useful. Enjoy.

Posted November 13th, 2007 by admin This entry was posted on Tuesday, November 13th, 2007 at 8:18 am and is filed under webmaster. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply