码迷,mamicode.com
首页 > Web开发 > 详细

通过js控制html页面不能右键,复制等

时间:2014-10-26 13:05:37      阅读:138      评论:0      收藏:0      [点我收藏+]

标签:io   ar   sp   on   art   cti   html   bs   new   

//Method one

 //document.oncontextmenu=new Function(‘event.returnValue=false;‘);
        document.oncontextmenu = function (e) { e = e || window.event; e.returnValue = false; }
        document.onselectstart = new Function(‘event.returnValue=false;‘);//]]>//method2

 

//Method two

<body oncontextmenu="return false" onselectstart="return false"></body>

通过js控制html页面不能右键,复制等

标签:io   ar   sp   on   art   cti   html   bs   new   

原文地址:http://www.cnblogs.com/jasonzeng/p/4051851.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!