码迷,mamicode.com
首页 > Web开发 > 详细

Web HTML页面,内容禁止选择、复制、右键

时间:2020-03-23 09:35:48      阅读:112      评论:0      收藏:0      [点我收藏+]

标签:doc   cts   bsp   sele   html   sem   use   cti   select   

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

<!--关键于以下参数的设置--> 
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>中加入

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

 

禁止网页另存为,在<body>加入:

<noscript> 
  <iframe src="*.htm"></iframe> 
</noscript> 

 

禁止网页内容复制、粘贴,在<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()">

  

创建时间:2020.03.23  更新时间:

 

Web HTML页面,内容禁止选择、复制、右键

标签:doc   cts   bsp   sele   html   sem   use   cti   select   

原文地址:https://www.cnblogs.com/guorongtao/p/12550102.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!