屏蔽鼠标右键、Ctrl+N、Shift+F10、Alt+F4、F11、F5刷新、退格键
作者:bea
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <noscript><meta http-equiv="refresh" content="0;url=about:noscript"></noscript> <title>屏蔽鼠标右键、Ctrl+N、Shift+F10、Alt
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<noscript><meta http-equiv="refresh" content="0;url=about:noscript"></noscript>
<title>屏蔽鼠标右键、Ctrl+N、Shift+F10、Alt+F4、F11、F5刷新、退格键</title>
</head>
<body>
<script>
//屏蔽鼠标右键、Ctrl+N、Shift+F10、F11、F5刷新、退格键
function document.oncontextmenu(){event.returnValue=false;}//屏蔽鼠标右键
function window.onhelp(){return false} //屏蔽F1帮助
function document.onkeydown(){
if((window.event.altKey)&&
((window.event.keyCode==37)|| //屏蔽Alt+方向键←
(window.event.keyCode==39))){ //屏蔽Alt+方向键→
alert("不准你使用ALT+方向键前进或后退网页!");
event.returnValue=false;
} if((event.keyCode==8)|| //屏蔽退格删除键
(event.keyCode==116)|| //屏蔽F5刷新键
(event.ctrlKey && event.keyCode==82)){ //Ctrl+R
event.keyCode=0;
event.returnValue=false;
}
if(event.keyCode==122){event.keyCode=0;event.returnValue=false;} //屏蔽F11
if(event.ctrlKey && event.keyCode==78)event.returnValue=false; //屏蔽Ctrl+n
if(event.shiftKey && event.keyCode==121)event.returnValue=false; //屏蔽shift+F10
if(window.event.srcElement.tagName=="A" && window.event.shiftKey)
window.event.returnValue=false; //屏蔽shift加鼠标左键新开一网页
if((window.event.altKey)&&(window.event.keyCode==115)){ //屏蔽Alt+F4
window.showModelessDialog("about:blank","","dialogWidth:1px;dialogheight:1px");
return false;
}
}
</script>
屏蔽鼠标右键、Ctrl+N、Shift+F10、Alt+F4、F11、F5刷新、退格键
</body>
</html>
[Ctrl+A 全选 注:
如需引入外部Js需刷新才能执行]
有用 | 无用
猜你喜欢
您可能感兴趣的文章:
- Javascript 入门基础学习
- javascript showModalDialog,open取得父窗口的方法
- ExtJs3.0中Store添加 baseParams 的Bug
- js Date自定义函数 延迟脚本执行
- javascript select options 排序(保持option 对象完整性)
- js 蒙版进度条(结合图片)
- javascript 事件查询综合 推荐收藏
- JQuery的html(data)方法与<script>脚本块的解决方法
- JQuery+div+css 无限级联树实现代码
- Jquery替换已存在于element上的event的方法
- JQery jstree 大数据量问题解决方法
- 魔鬼字典 JavaScript 笔记 代码比较多乱
- Javascript Math ceil()、floor()、round()三个函数的区别
- js 无提示关闭浏览器页面的代码
- JS 无法通过W3C验证的处理方法
- extjs 的权限问题 要求控制的对象是 菜单,按钮,URL
- javascript 简单抽屉效果的实现代码
- Javascript常考语句107条收集
- 风吟的小型JavaScirpt库 (FY.JS).