屏蔽F12 屏蔽复制 屏蔽剪切

<!-- 屏蔽F12 -->
<script>
document.onkeydown = function () {
if (window.event && window.event.keyCode == 123) {
alert("按错或者非法操作!苦海无边,回头是岸!");
event.keyCode = 0;
event.returnValue = false;
}
if (window.event && window.event.keyCode == 13) {
window.event.keyCode = 505;
}
if (window.event && window.event.keyCode == 8) {
alert(str + "\n请使用Del键进行字符的删除操作!");
window.event.returnValue = false;
}
}
</script>
<!-- 屏蔽F12 -->
<!-- 屏蔽复制 -->
<script>
document.oncopy = function (event) {
if (window.event) {
event = window.event;
}
try {
var the = event.srcElement;
if (!((the.tagName == "INPUT" && the.type.toLowerCase() == "text") || the.tagName == "TEXTAREA")) {
return false;
}
return true;
} catch (e) {
return false;
}
}
</script>
<!-- 屏蔽复制 -->
<!-- 屏蔽剪切 -->
<script>
document.oncut = function (event) {
if (window.event) {
event = window.event;
}
try {
var the = event.srcElement;
if (!((the.tagName == "INPUT" && the.type.toLowerCase() == "text") || the.tagName == "TEXTAREA")) {
return false;
}
return true;
} catch (e) {
return false;
}
}
</script>
<!-- 屏蔽剪切 -->

点赞