Advertisement
nomskoo

disable left click + alert / jvscript

Apr 2nd, 2024
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. <script language=JavaScript>
  2. <!--
  3.  
  4. //Disable right mouse click Script
  5. //By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
  6. //For full source code, visit http://www.dynamicdrive.com
  7.  
  8. var message="text text text text text text text";
  9.  
  10. ///////////////////////////////////
  11. function clickIE4(){
  12. if (event.button==2){
  13. alert(message);
  14. return false;
  15. }
  16. }
  17.  
  18. function clickNS4(e){
  19. if (document.layers||document.getElementById&&!document.all){
  20. if (e.which==2||e.which==3){
  21. alert(message);
  22. return false;
  23. }
  24. }
  25. }
  26.  
  27. if (document.layers){
  28. document.captureEvents(Event.MOUSEDOWN);
  29. document.onmousedown=clickNS4;
  30. }
  31. else if (document.all&&!document.getElementById){
  32. document.onmousedown=clickIE4;
  33. }
  34.  
  35. document.oncontextmenu=new Function("alert(message);return false")
  36.  
  37. // -->
  38. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement