Limit Downloads

[Total: 0    Average: 0/5]

This shows a simple way to limit the number of downloads a user makes.

Body Code:

<a href="javascript:downLoad('http://www.js-examples.com');">click to download</a>
<BR>
<script>
var LIMIT = 5;
function subOne() {
if (LIMIT-- <= 0) {
  alert("NO MORE");
  return false;
}
return true;
}
function downLoad(_l) {
  if (subOne()) {
    document.location=_l;
  }
}
</script>

Times Viewed: 1

Leave a Reply

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