让网页不能被复制

怎么让网页不能被复制,不能被右键看源码

添加一下javascript脚本即可:

<script>
			document.oncontextmenu = function(){ 
			showDialog('Copying is not allowed! Please contact me if you need it', 'alert');
			return false; 
			} 
			document.onkeydown = function(){ 
			if (event.ctrlKey && window.event.keyCode==67 || window.event.keyCode==123){ 
			showDialog('Copying is not allowed! Please contact me if you need it', 'alert');
			return false; 
			} 
			} 
			document.body.oncopy = function (){ 
			showDialog('博客禁止复制,请您尊重版权!', 'alert');
			return false; 
			} 			 
</script>  
Table of Contents