Hàng 1: Cấm click Ctrl, chuột phải, trái, và toàn bộ... toàn bộ bàn phím ấy
- Code:
<script language="JavaScript">
//Fixed
//No Leaking!
var isnn,isie
if(navigator.appName=='Microsoft Internet Explorer') //check the browser version
{ isie=true }
if(navigator.appName=='Netscape')
{ isnn=true }
function right(e) //to stop anyone using the right click mouse button
{
function ejs_nodroit() { alert('Blocked!');
return(false); } document.oncontextmenu = ejs_nodroit;
return true;
}
//to stop Ctrl and Alt keys:
function key(k)
{
if(isie) {
if(event.keyCode==17 || event.keyCode==18 || event.keyCode==93) {
alert("Blocked")
return false;
}
}
if(isnn){
alert("Blocked")
return false; }
}
if (document.layers) window.captureEvents(Event.KEYPRESS);
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (document.layers) window.captureEvents(Event.MOUSEUP);
document.onkeydown=key;
document.onmousedown=right;
document.onmouseup=right;
window.document.layers=right;
</script>
- Code:
<body oncontextmenu="return false"</body>