1. 程式人生 > >js靜止開啟右鍵選單和控制檯

js靜止開啟右鍵選單和控制檯

document.oncontextmenu = new Function("return false;"); document.onkeydown = document.onkeyup = document.onkeypress = function (e) { var e = event || window.event || arguments.callee.caller.arguments[0]; if (e.keyCode == 123) { alert('禁止開啟控制檯'); e.returnValue = false; return (false); } }