因为专注
所以专业

网页文字和图片不能复制怎么办

文字不能复制怎么办
http://pan.baidu.com/share/link?shareid=293298&uk=3877606752

图片不能复制怎么办
http://pan.baidu.com/share/link?shareid=293296&uk=3877606752

用JAVA禁止复制网页内容
<Script Language=javascript>
function key(){
//if(event.shiftKey){
//window.close();}
//禁止shift
if(event.altKey){
alert(‘禁止CTRL-C复制本贴内容’);}
//禁止alt
if(event.ctrlKey){
alert(‘禁止CTRL-C复制本贴内容’);}
//禁止ctrl
return false;}
document.onkeydown=key;
if (window.Event)
document.captureEvents(Event.MOUSEUP);
//swordmaple javascript article.
//from www.xiaoxinglai.com
//function nocontextmenu(){
//event.cancelBubble = true
//event.returnValue = false;
//return false;}
function norightclick(e){
if (window.Event){
if (e.which == 2 || e.which == 3)
return false;}
else
if (event.button == 2 || event.button == 3){
event.cancelBubble = true
event.returnValue = false;
return false;}
}
function Click(){
alert(‘禁止右键粘贴本贴内容’);
window.event.returnValue=false;
}
document.oncontextmenu=Click;
</Script>

一个更简单的方法就是在<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()”>

SEO  https://www.xiaoxinglai.com/

 

未经允许不得转载:肖兴来SEO博客 » 网页文字和图片不能复制怎么办
分享到: 更多 (0)

评论 2

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
  1. #1

    你知道吗?皇冠网

    爱我吧!11年前 (2013-03-01)回复
  2. #2

    一般遇到这种情况,我都看源码,呵呵

    企业SEO11年前 (2013-03-06)回复