我的禁止复制代码没有用

来源:百度知道 编辑:UC知道 时间:2024/05/17 09:28:36
<script language="javascript>
function click() {
alert ('leftkey is forbidon!')}
function click1() {
if (event.button==2) {
alert('rightkey is forbidon')}}
function CtrlKeyDown(){
if (event.CtrlKey){
alert('nonono')}}
document.onkeydown=CtrlKeyDown;
document.onselectstart=click;
document.onmousedown=click1;
</script>
我加到了<head>...</head>中间,但是出来以后,没有效果。是哪里的问题?求助,在线

<script language="javascript>
后面少了一个引号

不过不要对这类代码抱太大希望,只对菜鸟有用,如果在浏览器中输入下列代码,再回车,即可解除禁用:
javascript:function document.oncontextmenu(){return true;} function document.onselectstart(){return true;} function document.onsdragstart(){return true;} function document.body.onmouseup(){}function document.body.oncopy(){}function document.body.onbeforecopy(){}function document.onmousedown(){}