title: How can I count the number of clicks and then send an ajax request with that number?
body: <p>I have a button that I want to run a function that will make an ajax call and update click_count on my db.</p>
  
  <pre><code>$.ajax({
          url: 'my_url'
          type: 'post',
          data: {id: 1},
          success: function(response){
              console.log(response.click_count);
          }
      });
  </code></pre>
  
  <p>Now, I want to simplify ajax call when user click button quickly.
  For example, if user click the button 10 times quickly, i will send request with param like:</p>
  
  <pre><code>$.ajax({
          url: 'my_url'
          type: 'post',
          data: {id: 1, click_count:10}, // click_count=10;
          success: function(response){
              console.log(response.click_count);
          }
      });
  </code></pre>
  
  <p>So I just send 1 ajax request for 10 clicks instead of 10 requests.</p>