Support Forums

Full Version: Disable Right Click
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello everyone this is a small javascript that will save you site from being copied.
Code:
<script>
var isNS = (navigator.appName == "Netscape") ? 1 : 0;
  if(navigator.appName == "Netscape") document.captureEvents(Event.MOUSEDOWN||Event.MOUSEUP);
  function mischandler(){
   return false;
}
  function mousehandler(e){
    var myevent = (isNS) ? e : event;
    var eventbutton = (isNS) ? myevent.which : myevent.button;
    if((eventbutton==2)||(eventbutton==3)) return false;
}
document.oncontextmenu = mischandler;
document.onmousedown = mousehandler;
document.onmouseup = mousehandler;
  </script>

+rep would be appreciable
(10-12-2009, 02:27 AM)danger Wrote: [ -> ]Hello everyone this is a small javascript that will save you site from being copied.

It's not, yes the right click is disabled but you can still view the Source code with CTRL+U in FF

But thanks it's a nice script
thankx.


tahnx
Thanks alot. I've been searching it for such a long time.
Cant stop code from being viewed. This just makes it a little harder is all.