现在的位置: 首页技术Learn>正文
禁止复制图片、文章的JS代码
2010年08月23日 技术Learn 暂无评论 ⁄ 被围观 205 次+
<!--禁止复制 start-->
<script type="text/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>
<!--禁止复制 end-->
使用方法:将该代码放到需要禁止复制的页面代码</body>前即可。
注:对于懂得看源代码的技术人员,此方法是无效的哦。




给我留言

留言无头像?

无觅相关文章插件,快速提升流量

×
订阅本站
腾讯微博