Ads 468x60px

.

Social Icons

.

How to disable copy function in blogger




Disable Select All Text For Sites
Today, I want my readers to know how to protect your hard work put on creating and writing new articles on your website or blog from being copied by others.
Copying the text from your site 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. This trick is valid for any sites. This trick is going to disable (Ctrl+A) function for your site.

FOLLOW THE STEPS,
1. Go to Dashboard 
2. Go to Layout > Add a Gadget > Select "HTML/JavaScript gadget"
3. Paste the following code in the box:

<script type="text/javascript">
var omitformtags=["input", "textarea", "select"]
function disableselect(e){
for (i = 0; i < omitformtags.length; i++)
if (omitformtags[i]==(e.target.tagName.toLowerCase()))
return;
return false
}
function reEnable(){
return true
}
function noSelect(){
if (typeof document.onselectstart!="undefined"){
document.onselectstart=new Function ("return false")
if (document.getElementsByTagName){
tags=document.getElementsByTagName('*')
for (j = 0; j < tags.length; j++){
for (i = 0; i < omitformtags.length; i++)
if (tags[j].tagName.toLowerCase()==omitformtags[i]){
tags[j].onselectstart=function(){
document.onselectstart=new Function ('return true')
}
if (tags[j].onmouseup!==null){
var mUp=tags[j].onmouseup.toString()
mUp='document.onselectstart=new Function (\'return false\');\n'+mUp.substr(mUp.indexOf('{')+2,mUp.lastIndexOf('}')-mUp.indexOf('{')-3);
tags[j].onmouseup=new Function(mUp);
}
else{
tags[j].onmouseup=function(){
document.onselectstart=new Function ('return false')
}}}}}}
else{
document.onmousedown=disableselect
document.onmouseup=reEnable
}
}
window.onload=noSelect;
</script>

4. Save your work
!!! Check out how it works.
                              ENJOY THE TRICK

0 comments:

Post a Comment

Send Free SMS To All Pakistani Mobile Numbers



Message:
                          characters left