Skip to content

Instantly share code, notes, and snippets.

@ziadoz
Created July 5, 2012 17:03
Show Gist options
  • Save ziadoz/3054893 to your computer and use it in GitHub Desktop.
Save ziadoz/3054893 to your computer and use it in GitHub Desktop.
jQuery Debounce Key Up
// Throttle / Debounce Plugin: http://benalman.com/projects/jquery-throttle-debounce-plugin/
$(document).ready(function() {
var callback = function(event) {
event.preventDefault();
// Do exciting things here.
};
$('form.search').on({
submit: callback,
keyup: $.debounce(350, callback)
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment