Advertisement
f-ashionabelle

Disable right click on your blog tutorial

Jul 27th, 2014
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. BLOCKING/DISABLE RIGHT CLICK ON YOUR BLOG TUTORIAL:
  2.  
  3. 1. Copy this code:
  4.  
  5. <script language=JavaScript>
  6. <!--
  7.  
  8. //Disable right mouse click Script
  9. //By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
  10. //For full source code, visit http://www.dynamicdrive.com
  11.  
  12. var message="Function Disabled!";
  13.  
  14. ///////////////////////////////////
  15. function clickIE4(){
  16. if (event.button==2){
  17. alert(message);
  18. return false;
  19. }
  20. }
  21.  
  22. function clickNS4(e){
  23. if (document.layers||document.getElementById&&!document.all){
  24. if (e.which==2||e.which==3){
  25. alert(message);
  26. return false;
  27. }
  28. }
  29. }
  30.  
  31. if (document.layers){
  32. document.captureEvents(Event.MOUSEDOWN);
  33. document.onmousedown=clickNS4;
  34. }
  35. else if (document.all&&!document.getElementById){
  36. document.onmousedown=clickIE4;
  37. }
  38.  
  39. document.oncontextmenu=new Function("alert(message);return false")
  40.  
  41. // -->
  42. </script>
  43.  
  44. ** In the code where it says 'Function Disabled!', you can change to whatever message you'd like to put
  45. ** The message will appear once you right clicked your blog
  46.  
  47. 2. Paste the code before the </body> tag
  48.  
  49. ** If it doesn't work, try to put the code between <head> </head> tags
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement