禁止右鍵 和F12檢視原始碼
阿新 • • 發佈:2019-02-07
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<script>
window.onload=function(){
document.onkeydown=function(){
var e=window.event||arguments[0];
if(e.keyCode==123){
alert("小樣你想幹嘛?");
return false;
}else if((e.ctrlKey)&&(e.shiftKey)&&(e.keyCode==73)){
alert("還是不給你看。。");
return false;
}else if((e.ctrlKey)&&(e.keyCode==85)){//追加
return false;
}
};
document.oncontextmenu=function(){
alert("小樣不給你看");
return false;
}
}
</script>
<body>
</body>
</html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<script>
window.onload=function(){
document.onkeydown=function(){
var e=window.event||arguments[0];
if(e.keyCode==123){
alert("小樣你想幹嘛?");
return false;
}else if((e.ctrlKey)&&(e.shiftKey)&&(e.keyCode==73)){
alert("還是不給你看。。");
return false;
}else if((e.ctrlKey)&&(e.keyCode==85)){//追加
return false;
}
};
document.oncontextmenu=function(){
alert("小樣不給你看");
return false;
}
}
</script>
<body>
</body>
</html>