The function is very simple and the code is very concise. I won’t talk much nonsense here. I will just provide the source code and take it away if I need it.
The code copy is as follows:
function click(e) {
if (document.all) {
if (event.button==2||event.button==3) { alert("Welcome to the humble house. If you need any help, please contact the webmaster! Thank you for your cooperation!!!");
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;")
document.onkeydown = document.onkeyup = document.onkeypress=function(){
if(window.event.keyCode == 123) {
window.event.returnValue=false;
return(false);
}
}
<--123--112 is the number of codes for F1-F12-->
This is for others not to read your code. For those who don’t understand, if they are veterans, they can’t help!