Selasa, 20 September 2011

Disable Right Click in Your Website

Now we learn about JS or Javasript, need explanation ? sorry i'm not in mood to explain that...^_^
In this article i will share about how to disable right click mouse in your website or blog, for what ?
for avoid copy - paste ? that useless, block the object and press "CTRL + C" that object will be copied and ready for paste, so why you share that useless thing ? hhhaha..take it easy bro..
this is what i say knowledge, even useless thing is a knowledge.
Make new files and add this following code :

var message ="Right Click Disable";

function clickIE4() {
if (even.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")
look in this line "var message ="Right Click Disable";", this is alert message, if someone press right click in your website this alert message will come out, you can change as you wish. Save as Antirightclick.js.

For insert this JS, just add this following code right after </body>



<script language="JavaScript" src="Antirightclick.js" type="text/javascript"></script>
Good luck...^_^
Quotes for this post :
Life is about yesterday, now and tomorrow


0 komentar:

Posting Komentar

Lebih baik diam daripada tidak bisa bicara baik, (Silent is gold)