23 June 2010

disable right click.

nak mengamalkan safety first cam aku?hehe.meh kongsi code alert ineh.

 WITH ALERT




 promote blog ailyl jap.
 
layout>>page element>>add gadget>>html/jvscrpt (CTRL+C and paste di ruangan td) 


 <script language="JavaScript">
<!--

//Disable right mouse click Scriptoo
var message="YO MESSAGE DI CNI!!";

///////////////////////////////////
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>


_______________________________________________________________


WITHOUT ALERT




(nothing appear)

 layout>>page elemnt>>add gadget>>html/javascrpt (CTRL+C code ineh dan paste kt ruangan td)

 <script language=JavaScript>
<!--

//Disable right click scriptoo

var message="";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function("return false")
// -->
</script>






**selamat mencube.kalu ade error sila laporkn segera.mb ade silap code. :)




noktah


6 comments:

  1. ap mksd with alert dgn witout alert kak zaty ?

    ReplyDelete
  2. ap mksd with alert dgn witout alert kak zaty ?

    ReplyDelete
  3. oho,with alert,die akan kuar pop up.

    without,die x kuar pape.cam page kak zty. :)

    ReplyDelete
  4. TengS ZAty..^^ ira cbe gak usha2 sbelum ni..xjumpe punn.. huhu
    newbie here.. =) follow u..lau sudi follow ira blik ea..^^

    ReplyDelete

drop yo comment here,tenkiu.