HTML,Javascript ,Blog,Blogging tricks.
Well we all face problem of some or other copy cats lurking around to copy data from our blog or website.

It is hard written work, We take our valuable time and write content.

But someone visits your blog and just copies your materials and goes of with data.
And sometimes end up getting higher page views than yours and getting better reviews.
I have seen many of my friends getting frustrated when petty thief copies data from their site and pastes word to word on his/her site.
So I decided to write this article to help my those friends, who face this problem.

Here is the code

<script type=”text/javascript”>
var omitformtags=[“input”, “textarea”, “select”]
omitformtags=omitformtags.join(“|”)
function disableselect(e){
if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)
return false
}
function reEnable(){
return true
}
if (typeof document.onselectstart!=”undefined”)
document.onselectstart=new Function (“return false”)
else{
document.onmousedown=disableselect
document.onmouseup=reEnable
}
</script>
Now how to configure it?

Just head to your blog.
Open its source code that  is HTML file.
Take a backup of HTML file and save it on your computer.
In case you go somewhere wrong.
Now Copy the above code and paste it before
</body> tag. Thats it you are Done now save your file/HTML file.
Now upload that file to blog.Its done.
If you get any problem feel free to contact me.   

4 comments:

Doug Stephens said…

But what does this actually accomplish? What happens when someone tries to copy?
October 15, 2010 12:51 AM 

Alynne Leigh said…

I like the idea of protecting your work, but how does this do that?
October 27, 2010 12:56 AM 

sanketkingkong said…

@Alynne This Javascript Code disables the selecting of Content of Blog post or website and hence a user is unable to to Copy.
November 9, 2010 1:55 PM 

sanketkingkong said…

@Doug This is necessary to protect one hardwork as a blogger because many people just copy paste content from others blog… and steal the hard work
November 9, 2010 1:56 PM 

2 thoughts on “How to avoid copying of Data from website or Blog using javascript with Comments”

Leave a Comment

Scroll to Top