I was implementing anti-adblock on my site, since my bitcoin faucet runs by ads. The code I used to see if there is adblock on the clients browser was this: (I do have query if needed)
function TestPage() {
if ($('.advertisement').height() == 0)
var advertisement = "true";
}
$(TestPage);
Then I used this to see if the advertisement variable existed... (if it does then adblock is RUNNING on the clients browser.
<script type="text/javascript">
try {
if(advertisement) {
alert("EXISTS!");
}
} catch(e) {}
</script>
Now what i need it to do is to add disabled="" to my button if the advertisement variable exists... Like this
<input type="submit" name="faucet" disabled="" class="btn btn-default" value="Send">
I am a complete noob at javascript, and I need help doing this... Thanks!
I am slightly confused as to where to put the javascript. I have put the javascript in the head for now...