oh now I understand. thats very good then. I googled and found one script but I am not sure if it is the right one. are there a few good JS out there for usage?
thanks
There are a few, the one that I'm using is insanely simple to understand.
Basically, there is an external file in my FTP called ads.js. All ads.js contains is this code:
var canRunAds = true;
I then embed it into my website using this code:
<script src="/ads.js"></script>
Then, finally, I put my submit button in it's own <span> with an id, and then reference the variable to get the outcome.
<span id='subbtn'>
<input type = 'submit' class="btn btn-success" value = 'Claim Reward!'/><br>
</span>
<!--Check For Adblock-->
<script>
if(window.canRunAds === undefined){
document.getElementById('subbtn').innerHTML = 'Please disable adblock to claim.';
}
</script>
Basically, it checks if the variable exists, if it doesn't, it replaces the submit button with 'Please disable adblock to claim.'.
This works because Adblock's detection systems are shit, and will pretty much disable anything with the word ad in it.
Hi
Can you help me out on this one, I've followed your instructions & I get "Please disable adblock to claim" whether adblock is enabled or not.
I put
<script src="/ads.js"></script>
near the top of my index.php in my theme folder. & I've the ads.js in the theme & root folder, still no difference.
I also edited my code in the theme to look like this
<span id='subbtn'>
<input type="submit" class="btn btn-primary btn-lg" value="Get reward!">
</span>
<!--Check For Adblock-->
<script>
if(window.canRunAds === undefined){
document.getElementById('subbtn').innerHTML = 'Please disable adblock to claim.';
}
</script>
Any ideas what I'm doing wrong? I'd love to know what might be the problem, ie is it me or the code?
All suggestions/help appreciated