禁止复制代码

时间:2013-12-4 11:35  作者:三峡客  来源:本站原创  查看:2137  评论:0

1、取消选取、防止复制

<body onselectstart="return false">  

粘在网页最后的</html>之后

2、去掉表格网页之上空白(给第三行的<head>后加代码)

<body topmargin=0 marginheight=0>

3、固定字体大小(放在网页最后的</body>之后)

<style type="text/css">

<!--

body {font-size:10pt}

td {font-size:10pt}

-->

</style>


2、禁止文字图片复制代码( 不出现禁用文字,最好,放在网页最后 </html>的后面)


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

5、禁止文字图片复制代码

<SCRIPT LANGUAGE=javascript>

function click() {

alert('禁止你的左键复制!') }

function click1() {

if (event.button==2) {alert('禁止右键点击~!') }}

function CtrlKeyDown(){

if (event.ctrlKey) {alert('不当的拷贝将损害您的系统!') }}

document.onkeydown=CtrlKeyDown;

document.onselectstart=click;

document.onmousedown=click1;

</SCRIPT>


3、禁止文字复制代码


<script language="javascript" type="text/javascript">

<!--

function MM_reloadPage(init) { //reloads the window if Nav4 resized

if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {

document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}

else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();

}

MM_reloadPage(true);

//-->

</script>

</head>

<body leftmargin=0 topmargin=0 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()">

<noscript><iframe src="/blog/*>";</iframe></noscript>



相关评论