Skip to content

Instantly share code, notes, and snippets.

@iamnoah
Created April 26, 2010 17:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamnoah/379582 to your computer and use it in GitHub Desktop.
Save iamnoah/379582 to your computer and use it in GitHub Desktop.
// wait until the user pauses at least 500ms before doing validation
var timer;
$('.whatever').keypress(function() {
if(timer) clearTimeout(timer);
timer = setTimeout(validate,500);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment