The keypress doesn't detect CTRL + V
when pressed on the text box. I have seen a similar post to mine. But we have different implementation. I want to trigger an ajax request if the user idle in typing for 1.5 sec.
$(document).ready( function() {
$(document).on('keypress', '#subject-name', function() {
updateTimeOut( this, checkSubject );
});
});
The method updateTimeOut()
is something like this:
var updateTimeOut = function( textBoxObject, ajaxCall ) {
if (timeoutReference) clearTimeout(timeoutReference);
timeoutReference = setTimeout(function() {
doneTyping.call( textBoxObject, ajaxCall );
}, 1500);
};
My question is. Is't better to use change
is the best for my task? Does change
can also do check with interval?