Friday, 31 May 2013

How to copyright protect your blog using javascript

Leave a Comment
Today  let's try something new using Javascript code. In web sites javascript is an unavoidable part.If turned off it may cause many security threats to your site. javascript can be interesting too . It is widely used for creating pop ups,forms etc.

But today we are using javascript for protecting your site from content copiers.

it  is very simple method for protecting your content in your blog / website.

There are various softwares and websites now which allows you to have much security from copying content or  something like that but the question is are they free ? Obviously no! they offer you security in exchange for money.But i must say there are some sites which also allows you to check some sort of content copying for free .Such sites include copyscape, myfreecopyright ...etc. In case of some of you may find this tutorial helpful.So in this tutorial, i'm goin to teach you how to protect your content of your website by just disabling the ' Right click ' using  Javascript.

this method is quite easy to use.

just  paste  the below javascript code into your website / blog.....

<script language=javascript>
<!-- -->
    var message = "Hey stop ! Don't do that.";
    function rtclickcheck(keyp){ if (navigator.appName == "Netscape" && keyp.which == 3){     alert(message); return false; }
    if (navigator.appVersion.indexOf("MSIE") != -1 && event.button == 2) {     alert(message);     return false; } }
    document.onmousedown = rtclickcheck;

of course you need to change the script according to your site i have highlighted the parts where you have to change the values. Also you are also able to edit the message that appears when the code is executed like i did.

if you have tested the code you can see that whenever a user attempt a right click,a message shows ups.

Remember as   i said it is a simple method , we can also override the command. As you can see if he message appears more than one time,there is an option from which we can disable the code for next refresh.
So, it's just a temporary protection for your site and take it that way.

hope you enjoyed.

 cheers ! :)



Post a Comment

Feel Free to Comment