禁止右键菜单代码、禁止复制粘贴代码
<script type="text/javascript">
document.oncontextmenu = 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;
}
}
document.onpaste = 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; }
}
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;
}
}
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; }
}
document.onselectstart = 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>