Stop 1s on request when input is getting focus
var timeoutId = 0;
$('#id').off('keyup').on('keyup', function (event) {
clearTimeout(timeoutId);
timeoutId = setTimeout(function () {
$.ajax({
url: '__MODULE__/Base/getSearchStation',
dataType: 'json',
data: {'search': ''},
type: 'POST',
success: function (re) {
//do something
}
});
}, 1000);
});