JSP中鼠标禁用代码

//方法一
在 <body>与</body>之间加入:
<script language="javascript">
function click() {
if (event.button==2) {
alert('去,不准偷看。')
}
}
document.onmousedown=click
</script>



<script language="javascript">
document.oncontextmenu=stop
</script>


//方法二
oncontextmenu='return false'
ondragstart='return false'
onselectstart ='return false'
onselect='document.selection.empty()' oncopy='document.selection.empty()'
onbeforecopy='return false'
onmouseup='document.selection.empty()'

//jsp中禁用鼠标右键,禁止复制粘贴,双击鼠标滚动屏幕的代码
onmouseup=document.selection.empty()
oncontextmenu="return false"
onselectstart="return false"
ondragstart="return false"
onbeforecopy="return false"
onselectstart="return false" oncut="return false;" oncopy="return false;"
leftMargin=0 topMargin=0 marginheight="0" marginwidth="0"
oncopy=document.selection.empty()
leftMargin=0
topMargin=0
onselect=document.selection.empty()

你可能感兴趣的:(JavaScript,jsp,function)