Mob: +91 706-199-9900 | +91 995-370-9380

disable copying text

Copying the text from your site and blog and posting it elsewhere is common on the Internet. There are sites which doesn’t allow us to copy the text from the web pages. The copy function is disabled in the site by the site admin in order to protect the site. We will see how to implement the same methodology for Blogger and website. This trick is valid for any sites. This trick is going to disable (Ctrl+A) function for your.

So, to prevent this from being copied the content, you can use some java script code, that you help you. Here it the code:

 

<script type="text/javascript">
window.onload = function() {
disableSelection(document.body)
}
function disableSelection(target){
if (typeof target.onselectstart!="undefined")
target.onselectstart=function(){return false}
else if (typeof target.style.MozUserSelect!="undefined")
target.style.MozUserSelect="none"
else
target.onmousedown=function(){return false}
target.style.cursor = "default"
}
function mousedwn(e) {
try { if (event.button == 2||event.button == 3) return false; }
catch (e) { if (e.which == 3) return false; }
}
document.oncontextmenu = function() { return false; }
document.ondragstart = function() { return false; }
document.onmousedown = mousedwn;
</script>
 

One response to “How to Disable copying text from Webpage or Blog?”

  1. 78Azucena says:

    I must say you have hi quality articles here. Your page should go viral.
    You need initial traffic only. How to get it? Search for: Etorofer’s strategies

Leave a Reply

Your email address will not be published. Required fields are marked *