In the field of blogging there are large number of people who steal the contents from other websites to republish it in their website, so in this article i'm going to share a JavaScript which will help you to make your content protected.
I Started a Health Website few days ago and i need to protect my contents to be copied, to do this i tried some couple of codes but all the codes were not working, i met my friend who is expert in coding, he suggested me a JavaScript which works successfully in my blog. Today I gonna share that amazing JavaScript which will protect your blog contents to be stolen.
If you are using Blogger then just login to your blogger account and go through the Layout section, After that Click Add Gadgets and then Paste the below code and save it.
<!-- START disable copy paste --><script src='demo-to-prevent-copy-paste-on-blogger_files/googleapis.js'></script><script type='text/javascript'> if (typeof document.onselectstart!="undefined" ) { document.onselectstart=new Function ("return false" ); } else{ document.onmousedown=new Function ("return false" ); document.onmouseup=new Function ("return true" ); } </script><!-- END disable copy paste -->
After saving it just wait for 5-10 minutes after that open your website or blog then check it. In this script the right click of mouse is not allowed that's why no one can copy it, Besides it Ctrl+A button will also not work due to which no will be able to select all the words to be copied.