Skip to content

Instantly share code, notes, and snippets.

@jfgomez86
Created December 29, 2010 15:59
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 jfgomez86/758665 to your computer and use it in GitHub Desktop.
Save jfgomez86/758665 to your computer and use it in GitHub Desktop.
$(field).keydown(function () {
var $self = this;
if ($(this).data("lastTimeout")) clearTimeout($(this=).data("lastTimeout"));
$(this).data("lastTimeout", setTimeout(function () {
$.get("/subdomain_validator", {subdomain: $($self).val()}, function (data) {
// ...
});
}, 200));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment