1dners

Disable Right Click

Mar 1st, 2012
1,758
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.81 KB | None | 0 0
  1. <script language=JavaScript>
  2. <!--
  3. var message=" * INSERT YOUR OWN WORDS HERE. * ";
  4. ///////////////////////////////////
  5. function clickIE4(){
  6. if (event.button==2){
  7. alert(message);
  8. return false;
  9. }
  10. }
  11. function clickNS4(e){
  12. if (document.layers||document.getElementById&&!document.all){
  13. if (e.which==2||e.which==3){
  14. alert(message);
  15. return false;
  16. }
  17. }
  18. }
  19. if (document.layers){
  20. document.captureEvents(Event.MOUSEDOWN);
  21. document.onmousedown=clickNS4;
  22. }
  23. else if (document.all&&!document.getElementById){
  24. document.onmousedown=clickIE4;
  25. }
  26. document.oncontextmenu=new Function("alert(message);return false")
  27. // -->
  28. </script>
  29.  
  30. //////////////
  31. REMOVE BELOW
  32. Tutorial:
  33. Make sure your HTML has a <head> code, then proceed to paste it (the code above) BEFORE the <head> code in order for it to work.
  34. //////////////
Advertisement
Add Comment
Please, Sign In to add comment