$(document).keyup.(function(event){
alert(event.which);//显示按键对应的数字编号
})
当前js被多次加载,keyup事件就会被多次绑定,出现按一次按键,执行多次事件的情况
$(document).unbind("keyup").keyup.(function(event){
alert(event.which);
})
避免按一次按键,多次执行,绑定keyup事件前,先解绑。keydown同理
$(document).keyup.(function(event){
alert(event.which);//显示按键对应的数字编号
})
当前js被多次加载,keyup事件就会被多次绑定,出现按一次按键,执行多次事件的情况
$(document).unbind("keyup").keyup.(function(event){
alert(event.which);
})
避免按一次按键,多次执行,绑定keyup事件前,先解绑。keydown同理