-
-
Save wisnubaldas/f5e89211bb4dacdf0331655a91f10496 to your computer and use it in GitHub Desktop.
Revisions
-
Kcko revised this gist
Nov 16, 2018 . 1 changed file with 14 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ $('#mySearch').keyup(function() { var $this = $(this); clearTimeout($.data(this, 'timer')); var wait = setTimeout(function(){ $.get("query.php?q="+$this.val()); }, 1); $(this).data('timer', wait); }); -
Kcko revised this gist
Apr 16, 2018 . 2 changed files with 14 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +0,0 @@ This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ var delay = (function(){ var timer = 0; return function(callback, ms){ clearTimeout (timer); timer = setTimeout(callback, ms); }; })(); $('input').keyup(function() { delay(function(){ alert('Time elapsed!'); }, 1000 ); }); -
Kcko revised this gist
Apr 10, 2018 . 1 changed file with 9 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ var timeout = null $('input').on('keyup', function() { var text = this.value clearTimeout(timeout) timeout = setTimeout(function() { // Do AJAX shit here console.log(text) }, 500) }) -
Kcko created this gist
Jul 24, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ $('#mySearch').keyup(function() { clearTimeout($.data(this, 'timer')); var wait = setTimeout(search, 500); $(this).data('timer', wait); });