js禁止鼠标右键和禁止ctrl+c复制

<script type="text/javascript">
//禁止ctrl复制
document.onkeydown=function(){
    if((event.ctrlKey) && (window.event.keycode==67)){
          event.returnValue=false;
          alert("Ctrl+C被禁止啦!");
    }
}
document.onmousedown=function(){
    if(event.button==2){
        event.returnValue=false;
        alert("右键被禁止啦!");
    }
}

</script>

 

posted on 2014-05-13 21:04  false~  阅读(10148)  评论(0编辑  收藏  举报

导航