Friday, January 9, 2015

How to disable text selection in your Blog or website.. Disable the copy paste ..

In one of our previous posts, we presented a tutorial that shows you how you can disable the right-click function as a means to prevent (but not completely prevent) the contents of copiers without your consent.



disable text selection in Blogger

Here is another added measure you can use to make it even more difficult task for them. This technique is to disable text selection. The application of this technique on your Blogger blog is simple, just follow these steps: In your dashboard, go to Layout, and then click Add a Gadget. Select HTML / JavaScript, Copy and paste this code below:

<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>

Then save the widget and you're done.
Go ahead and try to select any text on your page. You will see that you will not be able to show anything, not even the images elsewhere.
Share this post
  • Share to Facebook
  • Share to Twitter
  • Share to Google+
  • Share to Stumble Upon
  • Share to Evernote
  • Share to Blogger
  • Share to Email
  • Share to Yahoo Messenger
  • More...

0 comments

:) :-) :)) =)) :( :-( :(( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ :-$ (b) (f) x-) (k) (h) (c) cheer

 
Posts RSSComments RSSBack to top
© 2015 Net Explain ∙ Designed by BlogThietKe
Released under Creative Commons 3.0 CC BY-NC 3.0