Support Forums
Disable Right Click - Printable Version

+- Support Forums (https://www.supportforums.net)
+-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87)
+--- Forum: Webmaster Support (https://www.supportforums.net/forumdisplay.php?fid=36)
+---- Forum: Website Development (https://www.supportforums.net/forumdisplay.php?fid=43)
+---- Thread: Disable Right Click (/showthread.php?tid=1299)



Disable Right Click - Akshay* - 10-12-2009

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


RE: Disable Right Click - Gaijin - 10-12-2009

(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


RE: Disable Right Click - hello - 10-12-2009

thankx.


tahnx


RE: Disable Right Click - Chris - 10-12-2009

Thanks alot. I've been searching it for such a long time.


RE: Disable Right Click - DAMINKā„¢ - 10-13-2009

Cant stop code from being viewed. This just makes it a little harder is all.