1、body中禁止复制
<BODY oncontextmenu="return false" onselectstart="return false" ondragstart="return false" onbeforecopy="return false" oncopy=document.selection.empty() onselect=document.selection.empty()>
2、功能更强的防复制js代码
<SCRIPT language=javascript1.2> /** *禁止复制 *site www.jb200.com */ function disableselect(e){ return false} function reEnable(){return true } file://if IE4+ document.onselectstart=new Function ("return false") file://if NS6 if (window.sidebar){ document.onmousedown=disableselect document.onclick=reEnable } </SCRIPT> <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>
3、防止页面被保存
<noscript><iframe src=""></iframe></noscript>
4、这个是css实现的禁止选择与复制的代码
<title>CSS禁止选择和复制</title> <meta http-equiv="content-Type" content="text/html;charset=gb2312"> <style> body{ -moz-user-select:none; hutia:expression(this.onselectstart=function(){return(false)}); } </style> </head> <body> 脚本学堂,欢迎大家的光临。 </body> </html>
您可能感兴趣的文章:
javascript 禁止复制网页的代码
javascript禁止页面操作(右键、复制、F5刷新)等代码
文本框禁用右键、复制、粘贴等功能的js代码