Wenn Sie nur für zwei sich wiederholende Zeichen suchen, dann können Sie dies tun:
var lastKey = '';
$('#Editbox1').on('keyup', function(e) {
//You probably don't want to check to see if they entered backspace twice.
//You could also check for other keys like this for example the ENTER key or the TAB key
//It might even make more sense to use keyCode ranges depending on your use
if (e.keyCode === 8) {
return;
}
//if the current key and last key were the same
if (lastKey === String.fromCharCode(e.keyCode)) {
alert();
//otherwise store the current key into the lastKey var to be check on the next keypress
} else {
lastKey = String.fromCharCode(e.keyCode);
}
});