When any user comes to your site or blog then he/she can easily access all the page source, So if you wanna to prevent access to your page contents, then follow these steps:
- Download javascript file from here.
- Open it, copy the javascript and paste it in your page from which you want to prevent access.
- For e.g. you can check this page source.
- You can't copy page contents even when you will click on view page source it will display links only.
<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>
4 comments
commentsI just sent this post to a bunch of my friends as I agree with most of what you’re saying here and the way you’ve presented it is awesome.
ReplyBest SEO Reseller
THNX BUDDY..
Replyhi, thanks for the help, Can u guys give us more detailed step by step how to go about adding this javascript to web page?
Replythanks
@rainy: paste the javascript on your webpages which you want to prevent from copying.
ReplyLike put it on your index page of the site.
Thank you for your comment.