Created
December 9, 2020 15:40
-
-
Save deyvicode/e02970db48904452b6de0a39b4d357d5 to your computer and use it in GitHub Desktop.
This file contains 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 characters
var delayTimer; | |
function doSearch(text) { | |
clearTimeout(delayTimer); | |
delayTimer = setTimeout(function() { | |
// Do the ajax stuff | |
}, 1000); // Will do the ajax stuff after 1000 ms, or 1 s | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment