1.禁用右键
document.oncontextmenu = function () {
return false;
}
2、复制禁用
<script>
function noCopy()
{
event.returnValue = false;
}
</script>
<body oncopy = "noCopy()">
3.另存为禁用
在<body>内容主体中加入<noscript><iframe src='*.html'></iframe></noscript>
4、缓存禁用
<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="Cache-Control" content="no-cache"/>
<meta http-equiv="Expires" content="0"/>
5.F12禁用
document.onkeydown = function (e) {
var currentKey = 0, k = e || window.event;
currentKey = k.keyCode || k.which || k.charCode;
if (currentKey == 123) {
window.event.cancelBubble = true;
window.event.returnValue = false;
}
}
6.CTRL+S禁用
document.onkeydown = function (e) {
if(e.ctrlKey == true && e.keyCode == 83) {
event.preventDefault();
}
}
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
暂无评论内容