title: jQuery : how to add a delay to an ajax request?
body: <p>i have a function which returns a certain ammount of data triggered in AJAX when typping. </p>
  
  <p>But, as soon as i type "long" string like "hello my name is", it launches a single request each time i type a key (10request at a single time and it takes 5 seconds to get 1 request response).</p>
  
  <p>How to avoid that please ? 
  (i don't want to use .onblur)</p>
  
  <pre><code>$(document).ready(function()
      {
        $('.search input[type="submit"]').hide();
  
        $('#search_keywords').keyup(function(key)
        {
          if (this.value.length &gt;= 2 || this.value == '')
          {
            $('#loader').show();
            $('#jobs').load(
              $(this).parents('form').attr('action'),
              { query: this.value + '*' },
              function() { $('#loader').hide(); }
            );
          }
        });
      });
  </code></pre>
  
  <p>Thank you ;)</p>