First, you have to include a JavaScript file with the name of advertisement.js. Due to AdBlock Plus' filtering rules, this file is automatically blocked. Thus we can use this file to do some stuff that we can test against later to see if the user is using an adblocker or not.
<script type="text/javascript" src="advertisement.js"></script>
The contents of which are:
document.write('<div id="tester">an advertisement</div>');
The file writes an element to the page that we will test for later. This element is made invisible by a CSS rule:
#tester {
display:none;
Now we use another piece of JavaScript at the location that we want the message to be displayed. This tests for the presence of the "tester" div we created earlier. If it's there, it means that ABP has not blocked our advertisement.js file and everything is good. If it's not there, it means that some sort of software blocked advertisment.js, and so we can write a special message to the page.
<script type="text/javascript">
if (document.getElementById("tester") != undefined)
{
document.write('<p class="yes">No <strong>AdBlock Plus</strong> detected! Thanks for truly supporting our site.</p>');
}
else
{
document.write('<p class="no">We\'ve detected that you\'re using <strong>AdBlock Plus</strong> or some other adblocking software. Please be aware that this is only contributing to the demise of the site. We need money to operate the site, and almost all of that comes from our online advertising. To read more about why you should disable ABP, please <a href="#">click here</a>.<!-- end .content --></p>');
}
</script>
Here is the source of the answer.