title: Wait 1 second before executing AJAX request onkeyup
body: <p>I've got an ajax request that executes every time an user presses some button (writes text) in a certain textarea. This would work great already (it is a search filtering function btw.), but it would n't be a good idea to execute the filter after each keystroke. So I was thinking about making a delayer thing. So the ajax request would only execute only when at least 1 second has passed since the user pressed the last button. How can I achieve this?</p>
  
  <pre><code>&lt;textarea id="text" name="text" onkeyup="Search()"&lt;/textarea&gt;
  
  function Search()
  {
      $.ajax({...
      ...
  }
  </code></pre>
  
  <p>So obviously it will run all the time. For example if I type "hello" into the textarea fast it will run 5 times and it has no use. It would be enough to run it only when I stopped writing for more than 1 second.</p>