Javascript To Disable Right Click And Stop Content Copying

Discussion in 'CSS & HTML & Javascript' started by Olayanju Kabir, Jun 2, 2017.

Javascript
  1. Olayanju Kabir

    Olayanju Kabir Itz Kofem Staff Member

    This is a simple J Javascript To Disable Right Click And Stop content copying

    It's recommended you place it after <head>

    Copy code Below

    Code:
    <script type="text/JavaScript">
    //Script courtesy of BoogieJack.com
    var message="NoRightClicking";
    function defeatIE() {if (document.all) {(message);return false;}}
    function defeatNS(e) {if
    (document.layers||(document.getElementById&&!document.all)) {
    if (e.which==2||e.which==3) {(message);return false;}}}
    if (document.layers)
    {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=defeatNS;}
    else{document.onmouseup=defeatNS;document.oncontextmenu=defeatIE;}
    document.oncontextmenu=new Function("return false")
    </script>
    
    <script type="text/JavaScript">
    //courtesy of BoogieJack.com
    function killCopy(e){
    return false
    }
    function reEnable(){
    return true
    }
    document.onselectstart=new Function ("return false")
    if (window.sidebar){
    document.onmousedown=killCopy
    document.onclick=reEnable
    }
    </script>
    
     
  2. Loading...

    Similar Threads - Javascript Disable Right
    1. Olayanju Kabir
      Replies:
      0
      Views:
      200

Share This Page