1、直接按F12
2、Ctrl+Shift+I查看
3、鼠标点击右键查看
4、Ctrl+u=view-source:+url
把以上三种状态都屏蔽掉就可以了,document有onkeydown(键盘按键事件),该事件里面找到对应的keycode并处理就可以,
document也有oncontextmenu鼠标右键事件,屏蔽即可。4里面的Ctrl+u是可以屏蔽的。
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;
}
}