
This script is very simple, which can completely help you to away people from copying your text/articles. However, we sometimes provide codes in our tutorials i.e widgets, plugins, tricks etc. So we usually use <BlockQuote> tag for those codes, but this script interrupt with that and the codes inside <BlockQuote> will suffer and won't be selected. So you'll need to always insert your codes inside a <textarea> tag instead of <blockquote>. Now let's start installing this script on blogger platform.
How to disable copying text in blogger?
Follow few simple steps to install a small piece of JavaScript code in your blog and get rid of copycats.- Go to Blogger
- Layout >> Add a Gadget >> Select HTML/JavaScript Gadget
- Now Copy below code and paste inside that HTML/JavaScript gadget
<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>
Save your template and view your blog for seeing the result. Just try to select any text and you'll see the changes. It will disable Select ALL CTRL+A and CTRL+C options on visitors keyboards.
This was a really cool script which will work better for everyone one who wants to get rid of thieves. I'm also planning to use this script on my blog, but after changing my all codes to <textarea>, because I've published many codes in <blockquote> tag.
Take care and let me know if something is not understood by you, comment below the post and keep in touch. Suggestions and recommendations are also welcomed.
No comments:
Post a Comment