I want to trigger an ajax request when the user has finished typing in a text box. I don\'t want it to run the function on every time the user types a letter because that wo
For passing parameters to your function along with ES6 syntax.
$(document).ready(() => { let timer = null; $('.classSelector').keydown(() => { clearTimeout(timer); timer = setTimeout(() => foo('params'), 500); }); }); const foo = (params) => { console.log(`In foo ${params}`); }