<
script language
=
"
JavaScript
"
>
<!--
function
key()
{
if(event.shiftKey){
window.close();}
//禁止shift
if(event.altKey){
window.close();}
//禁止alt
if(event.ctrlKey){
window.close();}
//禁止ctrl
return false;}
document.onkeydown
=
key;
if
(window.Event)
document.captureEvents(Event.MOUSEUP);
//
swordmaple javascript article.
//
from www.jx165.com
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
>
<
body onselectstart
=
"
return false
"
; onpaste
=
"
return false
"
;
>
选择字符试试1010110
<
input size
=
30
>
<!--
onselectstart禁止选择 onpaste禁止粘贴
-->
本文介绍了一个简单的JavaScript代码片段,该片段可以用于禁用网页上的右键菜单、文本选择以及粘贴功能,同时阻止Shift、Ctrl和Alt键的使用。适用于保护网站内容不被轻易复制。



2660

被折叠的 条评论
为什么被折叠?



