Guest User

Untitled

a guest
Jan 19th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. function ajax_lookup( event ) {
  2. // Perform an AJAX lookup on $(this).val();
  3. };
  4.  
  5. // Console logging happens on keyup, for every single key
  6. // pressed, which is WAAAY more often than you want it to.
  7. $('input').keyup( ajax_lookup );
  8.  
  9. // Console logging happens on window keyup, but only after
  10. // the user has stopped typing for 250ms.
  11. $('input').keyup( $.debounce( 250, ajax_lookup ) );
Add Comment
Please, Sign In to add comment