function click(e) { if (document .all) { if (event.button==1||event.button==2||event.button==3) { oncontextmenu='return false'; } } if (document.layers) { if (e.which == 3) { oncontextmenu='return false'; } } } if (document.layers) { document.captureEvents(Event.MOUSEDOWN); } document.onmousedown=click; document .oncontextmenu = new Function("return false;") var trxdyel=true var hotkey=17 /* hotkey is the key value of the hotkey, which is the ASII code, where 99 represents the c key*/ if (document.layers) document.captureEvents(Event.KEYDOWN) function gogo(e) { if (document.layers) { if (e. which==hotkey && trxdyel) { alert('Operation error. Maybe you pressed the wrong key!'); } } else if (document.all) { if (event.keyCode==hotkey&&trxdyel){ alert('Operation error. Maybe you pressed the wrong key!'); }} } document.onkeydown=gogo
Write the above JS code into a JS file, name it xp.js and put it into the Script folder. When quoting, you need to pay attention to setting Charset="gb2312", otherwise the information prompted will be garbled. Page reference:
no can be used in Table function click() { if (event.button==2) { alert(' Sorry, right click is disabled on this page! ') } } document.onmousedown=click
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn