You can use below javascript code to detect if adblocker is turned on 

What We are doing is : We are creating a image object (newImg) and loading an image which have name 'ad'. Which will be blocked by the adblocker. Then checking if there is any error in loading the image(newImag.onerror). If there is an error then we are displaying the error message in the HTML tag with id 'block'. You can customize the message as per your needs. Working in latest browsers but didn't tested in old browsers.


faltutech

Pursuing MCA from YMCA University, Faridabad

Leave a Reply

Your email address will not be published. Required fields are marked *

Read previous post:
WAP to Find Total Number of Occurrences of Each word in a Paragraph.(C++)
WAP to Find Total Number of Occurrences of Each word in a String (Paragraph) (C++)

Here we will count the number of times a word is found in a user input. We will be first...

Close