For example:
// cb = function to call with result
function detectAdblock(cb) {
var tt = document.createElement("div");
tt.style.display = "none";
document.body.appendChild(tt);
var i = document.createElement("iframe");
i.src = "http://adv.foo.com/ads/-adspace?ad_id=&affiliate=&advert=678";
var foo = i.style.cssText;
tt.appendChild(i);
window.setTimeout(function() {
cb(foo!=i.style.cssText);
}, 200);
}
This works because adblock is pretty primitive and just checks for keywords in the iframe src, and if there sets the visibility or display css style etc.To get around adblock, you can proxy through your own domain, and stay clear of showing the ads in iframe/image/flash. Use js to put them in with everything else as text links which perform far better than any other type of advertising anyway.
Out of curiosity, what kind of audience does your site have? Particularly tech savvy?
But there are a few heuristic methods, basically just loading an image from a blocked domain (it's a sure thing double click will be blocked), waiting, then checking the DOM to see if the element has been removed. Not fool proof, or specific to AdBlock but good enough.
I have a couple of detection demos (including flash block) here: