I have the following scenario:

```
$('button').on('click',function(){

    // Run AJAX commonds (May take some time);

});

```

So If the user clicks the button several times, he could be executing a `ajax` request a lot.

The logical way to solve this is to use 

```
var finished = true;
$('button').on('click',function(){
    if(finished == true){
        finished = false;
        ....
        finished = true;
    }

```

But adding global variables to every function seems bizarre? How can I fix this? I looked into `.off()` but this complete remove the event. `one()` just execute it once. I wan't it to execute multiple times. Maybe writing a simple plugin to take care of this functionality. Its repetitive.