Monday, December 17, 2012

Trick to prevent your content from being copied

This is a simple way to disable the text selection and the right click functionality on a webpage. It helps webpage owners protect their original contents from being copied.

Although this is a temporary method, but comes handy when your website comes across visitors that intent to simply copy your content into their pages and call it theirs.

All you need to do is copy these JAVASCRIPT code into your webpage.

To disable TEXT SELECTION

<!-- Disable Copy and Paste-->
<script language='JavaScript1.2'>
function disableselect(e){
return false
}
function reEnable()
{
return true
}
document.onselectstart=new Function (&quot;return false&quot;)
if(window.sidebar)
{
docment.onmousedown=disableselect
document.onclick=reEnable
}
</script>

Please see that you insert the above Javascript code in between the <head> and </head> section of your webpage.

Here is another JAVASCRIPT that disables Right click functionality on your page.

To disable Right Clicks


<script language=JavaScript>
<!--

//Disable right mouse click Script

//By Hackerzgeeknet


var message="Function Disabled! Copying others material is not a good idea. Create yours.";


///////////////////////////////////

function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){

if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){

document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")


// -->

</script>


Another suggestion is to watermark your images so that they may not be copied.

enJoy.

4 comments:

  1. Wow, this paragraph is nice, my younger sister is analyzing these kinds of things, thus I am going to inform her.
    Also see my website > Credit Repair Reviews

    ReplyDelete
    Replies
    1. Glad I am a help to your younger sister. Keep visiting for regular updates.

      -ADMIN

      Delete
  2. Abe apne me to kar le. ;-)

    ReplyDelete
    Replies
    1. Dear user, I appreciate your concern, but that won't be necessary as the post suggests to copy the code above. With the feature on, nobody can copy the post and it won't help anybody. Thanks still.

      -Admin

      Delete

Post Your Comments Here! Please don't forget to mention your name and e-mail address.