javascript - Trigger an ad for the first click on ANY part of the website -


there websites no matter click (background, random words, existing links, anything) ad pops up. example: first time click contact spam, if click contact again go "/contact" section.

i wonder how possible , how made.

like this:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>  <script>   = 0;    $(document).on('click','body',function(event){      if (i == 0) {      event.preventdefault();      //insert code display ad here      alert('spam here');      i++;      }    });    </script>        <body>  <div>blah blah blah</div>  <a href = "//stackoverflow.com">link here</a>    </body>

after first click, i no longer = 0, therefore default action of body elements restored.


Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -