网页禁止复制代码
2012-02-28 09:53
369 查看
<body oncontextmenu="return false" onselectstart="return false" ondragstart="return false"
onbeforecopy="return false" oncopy="document.selection.empty()" onselect="document.selection.empty()">
----------------------------------------------- 防止复制的js -----------------------------------------------
<script language="JavaScript" type="text/JavaScript">
function disableselect(e) {
return false
}
function reEnable() {
return true
}
file: //if IE4+
document.onselectstart = new Function("return false")
file: //if NS6
if (window.sidebar) {
document.onmousedown = disableselect
document.onclick = reEnable
}
</script>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init == true) with (navigator) {
if ((appName == "Netscape") && (parseInt(appVersion) == 4)) {
document.MM_pgW = innerWidth; document.MM_pgH = innerHeight; onresize = MM_reloadPage;
}
}
else if (innerWidth != document.MM_pgW || innerHeight != document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
----------------------------------------------- 防止下载的js -----------------------------------------------
<noscript>
<iframe src=""></iframe>
</noscript>
----------------------------------------------- 防止右键的js -----------------------------------------------
<script language="JavaScript">
<!--
if (window.Event)
document.captureEvents(Event.MOUSEUP);
function nocontextmenu() {
event.cancelBubble = true
event.returnValue = false;
return false;
}
function norightclick(e) {
if (window.Event) {
if (e.which == 2 || e.which == 3)
return false;
} else {
if (event.button == 2 || event.button == 3) {
event.cancelBubble = true
event.returnValue = false;
return false;
}
}
}
document.oncontextmenu = nocontextmenu; // for IE5+
document.onmousedown = norightclick; // for all others
//-->
</script>
onbeforecopy="return false" oncopy="document.selection.empty()" onselect="document.selection.empty()">
----------------------------------------------- 防止复制的js -----------------------------------------------
<script language="JavaScript" type="text/JavaScript">
function disableselect(e) {
return false
}
function reEnable() {
return true
}
file: //if IE4+
document.onselectstart = new Function("return false")
file: //if NS6
if (window.sidebar) {
document.onmousedown = disableselect
document.onclick = reEnable
}
</script>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init == true) with (navigator) {
if ((appName == "Netscape") && (parseInt(appVersion) == 4)) {
document.MM_pgW = innerWidth; document.MM_pgH = innerHeight; onresize = MM_reloadPage;
}
}
else if (innerWidth != document.MM_pgW || innerHeight != document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
----------------------------------------------- 防止下载的js -----------------------------------------------
<noscript>
<iframe src=""></iframe>
</noscript>
----------------------------------------------- 防止右键的js -----------------------------------------------
<script language="JavaScript">
<!--
if (window.Event)
document.captureEvents(Event.MOUSEUP);
function nocontextmenu() {
event.cancelBubble = true
event.returnValue = false;
return false;
}
function norightclick(e) {
if (window.Event) {
if (e.which == 2 || e.which == 3)
return false;
} else {
if (event.button == 2 || event.button == 3) {
event.cancelBubble = true
event.returnValue = false;
return false;
}
}
}
document.oncontextmenu = nocontextmenu; // for IE5+
document.onmousedown = norightclick; // for all others
//-->
</script>
相关文章推荐
- 网页禁止复制代码
- 禁止鼠标左右键代码/禁止网页选中/禁止另存为/防复制代码
- js网页禁止复制-禁止另存为-禁止选择-禁止鼠标右键代码
- 网页防复制代码 禁止查看网页源文件代码
- 禁止网页复制的代码
- 禁止网页右键、全选CTRL+A、复制的代码
- 禁止网页复制的代码
- 网页禁止右键、禁止查看源代码、禁止复制和另存为的代码
- 禁止鼠标左右键代码/禁止网页选中/禁止另存为/防复制代码
- 『小知识』网页中禁止复制的代码
- 禁止另存网页、屏蔽选中、粘贴、复制、剪切、右键菜单程序代码
- JS禁止网页被复制以及禁止鼠标右击代码
- 禁止网页复制代码
- 网页禁止保存复制代码大全
- 网页禁止右键、禁止查看源代码、禁止复制的代码
- 网页禁止保存复制代码大全
- 网页禁止右键、禁止查看源代码、禁止复制和另存为的代码
- 禁止鼠标左右键代码/禁止网页选中/禁止另存为/防复制代码
- 禁止网页复制的代码
- JavaScript代码轻松实现网页内容禁止复制(代码简单)