在<body>标签中添加以下代码:
oncontextmenu='return false' 禁止右键
ondragstart='return false' 禁止拖动
onselectstart ='return false' 禁止选中
onselect='document.selection.empty()' 禁止选中
oncopy='document.selection.empty()' 禁止复制
onbeforecopy='return false' 禁止复制
onmouseup='document.selection.empty()'
扩展资料
示例代码如下:
<body leftmargin=0 topmargin=0 oncontextmenu='return false' ondragstart='return false' onselectstart ='return false' onselect='document.selection.empty()' oncopy='document.selection.empty()' onbeforecopy='return false' onmouseup='document.selection.empty()'>
<input type="text" oncopy="return false" value="不能复制,包括鼠标右键"><input type="text" oncut="return false" value="不能剪切,包括鼠标右键">
<input type="text" onpaste="return false" value="不能粘贴,包括鼠标右键">
一个更简单的方法就是在<body>中加入如下的代码,这样鼠标的左右键都失效了.topmargin="0" oncontextmenu="return false" ondragstart="return false" onselectstart ="return false" onselect="document.selection.empty()" oncopy="document.selection.empty()" onbeforecopy="return false" onmouseup="document.selection.empty()"
1.禁止网页另存为:在<body>后面加入以下代码:<noscript><iframe src="*.htm"></iframe></noscript>
2.禁止网页内容复制.粘贴:在<body>中加入以下代码:<body onmousemove=\HideMenu()\ oncontextmenu="return false" ondragstart="return false" onselectstart ="return false" onselect="document.selection.empty()" oncopy="document.selection.empty()" onbeforecopy="return false" onmouseup="document.selection.empty()">
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)