HTML页面禁止选择、页面禁止复制、页面禁止右键 收藏
转自:http://hi.baidu.com/kelebing/blog/item/6f97a602d70489074afb517e.html
view plaincopy to clipboardprint?
οncοntextmenu='return false'
οndragstart='return false'
onselectstart ='return false'
οnselect='document.selection.empty()'
οncοpy='document.selection.empty()'
onbeforecopy='return false'
οnmοuseup='document.selection.empty()'
οncοntextmenu='return false'
οndragstart='return false'
onselectstart ='return false'
οnselect='document.selection.empty()'
οncοpy='document.selection.empty()'
onbeforecopy='return false'
οnmοuseup='document.selection.empty()'
一个更简单的方法就是在<body>中加入如下的代码,这样鼠标的左右键都失效了.
topmargin="0" οncοntextmenu="return false" οndragstart="return false" onselectstart ="return false" οnselect="document.selection.empty()" οncοpy="document.selection.empty()" onbeforecopy="return false" οnmοuseup="document.selection.empty()"
1.禁止网页另存为:在<body>后面加入以下代码:
<noscript>
<iframe src="*.htm"></iframe>
</noscript>
2.禁止网页内容复制.粘贴:在<body>中加入以下代码:
<body οnmοusemοve=/HideMenu()/ οncοntextmenu="return false" οndragstart="return false" onselectstart ="return false" οnselect="document.selection.empty()" οncοpy="document.selection.empty()" onbeforecopy="return false" οnmοuseup="document.selection.empty()">
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/popo0027/archive/2009/09/07/4527963.aspx