title: How can I prevent the user from clicking a button too fast, in order to prevent an extra ajax request?
body: <p>Imagine a button for liking or voting a page. I need this button to send Ajax request to record user's likes.</p>
  
  <p>The people who click the button very fast many times, cause a number of Ajax request.<br>
  How can I fix that?<br>
  When people click the button(<code>span</code>), 
  I need to prevent it from sending the Ajax request again until the previous Ajax request is done</p>
  
  <pre><code>&lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"&gt;&lt;/script&gt;
  &lt;span onclick="send_ajax(this)"&gt;send_ajax&lt;/span&gt;
  &lt;script type="text/javascript"&gt;
  
      function send_ajax(node){
          $.ajax({
              url:'ajax.php',
              type:'POST',
              data: {},
              success:function() {
  
              }
          });
      }
  &lt;/script&gt;
  </code></pre>