Advertising

review www.do11warnet.blogspot.com on alexa.com

Saturday, January 21, 2012

Disable KeyDown Ctrl C and V

<script language="javascript">
function onKeyDown() {
alert("Don't Leacher"); // commentnya
// current pressed key
var pressedKey = String.fromCharCode(event.keyCode).toLowerCase();
if (event.ctrlKey && (pressedKey == "c" ||
pressedKey == "v")) {
// disable key press porcessing
event.returnValue = false;
}
} // onKeyDown
</script>



<script language="JavaScript">
        //Disable klik kanan di mouse kamu
       
        
        //pesan yang akan ditampilkan bila kamu klik kanan
         var message="Sorry You Can't Copy Paste with Right Click";
        
        //Kode selanjutnya merupakan fungsi untuk mendisable klik kanannya
        function clickIE4(){
        if (event.button==2){
        alert(message);
        return false;
        }
        }
        function clickNS4(e){
        if (document.layers||document.getElementById&&!document.all){
        if (e.which==2||e.which==3){
        alert(message);
        return false;
        }
        }
        }
        if (document.layers){
        document.captureEvents(Event.MOUSEDOWN);
        document.onmousedown=clickNS4;
        }
        else if (document.all&&!document.getElementById){
        document.onmousedown=clickIE4;
        }
        document.oncontextmenu=new Function("alert(message);return false")
       
</script>


<script type="text/javascript">
<!--
//Disable select-text script (IE4+, NS6+)
///////////////////////////////////
function disableselect(e){
return false
}
function reEnable(){
return true
}
//if IE4+
document.onselectstart=new Function ("return false")
//if NS6
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}
// -->
</script>

No comments:

Post a Comment

Your Comment