您的位置:首页 > 其它

禁止右键 和F12查看源码

2018-04-02 15:02 253 查看
<!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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: