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()'
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()