随笔 - 147  文章 - 71  trackbacks - 0
<2009年10月>
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567

常用链接

留言簿(1)

随笔分类(146)

随笔档案(147)

文章分类(28)

文章档案(28)

喜欢的Blog

搜索

  •  

最新评论

阅读排行榜

评论排行榜

网页复制代码

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>复制 我的内容</title> 

<script type="text/javascript" language="javascript">
    
function copy(o)
    
{
        
var text=document.getElementById(o).innerText;
        window.clipboardData.setData(
"text",text);
        alert(
"复制成功");
    }

</script>
</head> 

<body>
<href="javascript:copy('span1');">复制</a>
<span id="span1">
    我的内容
</span>
</body> 

 

网页防复制代码


插入网页即可。
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="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()">
<noscript><iframe src="/blog/*>";</iframe></noscript>
1. oncontextmenu="window.event.returnvalue=false" //将彻底屏蔽鼠标右键
<table border oncontextmenu=return(false)><td>no</table> //可用于Table
------------------------------------------------------------------------------------------------------
2. <body onselectstart="return false"> //取消选取、防止复制
------------------------------------------------------------------------------------------------------
3. onpaste="return false" //不准粘贴
------------------------------------------------------------------------------------------------------
4. oncopy="return false;" oncut="return false;" // 防止复制
------------------------------------------------------------------------------------------------------
5. //防止被人frame
<SCRIPT LANGUAGE=javascript><!--
if (top.location != self.location)top.location=self.location;
// --></SCRIPT>
------------------------------------------------------------------------------------------------------
6. <noscript><iframe src="/blog/*.html>";</iframe></noscript> //网页将不能被另存为
------------------------------------------------------------------------------------------------------
7. //改变连接是状态栏的显示内容
〈a href="http://v.2best.cc/" onMo ... ;window.status='输入连接状态栏显示内容’;return true">
------------------------------------------------------------------------------------------------------
8. //禁止网页中目标对象被下载(如图片)
下面的代码将帮助你禁止网页中目标对象被下载:
<a href="javascript:void(0)" onMouseDown="alert('对不起!图片不能下载!')">
</a>
------------------------------------------------------------------------------------------------------
9. //页面禁止刷新完全
最好在pop出来的窗口里用,没工具栏的

<body onkeydown="KeyDown()" onbeforeunload="location=location"
oncontextmenu
="event.returnValue=false">
<script language="Javascript"><!--
function KeyDown(){
if ((window.event.altKey)&&
((window.event.keyCode
==37)||
(window.event.keyCode
==39))){ alert("请访问我的主页");
event.returnValue
=false;
}

if ((event.keyCode==8)|| (event.keyCode==116))//屏蔽 F5 刷新键
event.keyCode=0;
event.returnValue
=false;
}

if ((event.ctrlKey)&&(event.keyCode==78))//屏蔽 Ctrl+n
event.returnValue=false;
}

if ((event.shiftKey)&&(event.keyCode==121))//屏蔽 shift+F10
event.returnValue=false;
}

}

</script>
</body>
posted on 2009-10-23 10:38 飞翔天使 阅读(262) 评论(0)  编辑  收藏 所属分类: javascript

只有注册用户登录后才能发表评论。


网站导航: