我在我的MVC项目。我是创建保存键盘快捷键使用jQuery
,取消,对于添加新我使用Alt键 + 小号,Alt键 + ç,Alt键 + 小号,其对铬的工作,在Firefox,其Alt键 + 小号不工作。如何防止deault Alt + S键在Firefox
我使用这些codes-
$(document).on('keydown', function (e) {
// e.preventDefault();
e.preventDefault ? e.preventDefault() : event.returnValue = false;
var key = e.which || e.keyCode;
if (e.altKey === true && key === 78) {-Colling a Add Function
// AddCompany(); -i adding a new company
alert('Are You Want to Add New Company ');
}
if (e.altKey === true && key === 83) {-Colling a save Function
// funSaveCreation();- save function
alert('Are You Want to Save Company ');
}
if (e.altKey === true && key === 67) {--Colling a cancel Function
// Cancel();- cancel function
alert('Are You Want to Cancel ');
}
});
有任何人有这个想法? –