绑定单机右键事件,返回false
$(document).ready(function(){
$(document).bind("contextmenu",function(e){
return false;
});
});
关闭F12
document.onkeydown=function(event){
var e = event || window.event || arguments.callee.caller.arguments[0];
if(e && e.keyCode==123){
return false;
}
};
本文介绍了一种通过JavaScript禁用网页上的右键菜单及F12开发者工具的方法。具体实现包括使用$(document).bind('contextmenu')阻止右键事件以及利用document.onkeydown监听键盘事件来禁止F12键的功能。
509

被折叠的 条评论
为什么被折叠?



