I am using this example with jQuery 1.9.1
How to delay the .keyup() handler until the user stops typing?
to delay the keyup request after user stop typing.
// Custom Delay Function
var delay = (function(){
var timer = 0;
return function(callback, ms){
clearTimeout (timer);
timer = setTimeout(callback, ms);
};
})();
// Match Old Password
$('input[name="old_password"]').keyup(function(){
delay(function(){
var data = $.trim($(this).val());
// Send request to check
/*$.post('admin/ajax/passReq.php', {action: 'old_match', data: data}, function(response){
console.log('working');
});*/
console.log('working');
}, 2000 );
});
but i am getting the typeError: o.nodeName is undefined
in jquery :(
is this not working on 1.9.1 or i have to use this with another way?