Home » » How To Include Read More Link When Someone Copy Paste Your Content

How To Include Read More Link When Someone Copy Paste Your Content

Written By Unknown on July 28, 2014 | Monday, July 28, 2014

Few days before when i was surfing for the most recent news and I noticed(you may have additionally recognized that) in the event that you duplicate and glue any content from the site a reference connection is consequently included (at the base) of the duplicated content,which demonstrates the source from where you have replicated that.

I was astounded and was certain that i have duplicated just substance then how that connection additionally replicated and afterward attempted to evaluate how it happened and how to do it. I evaluated that they utilize an administration called "Tynt". Ya its cool yet who needed to utilize it.after all we are designers so i simply needed to check whether we could get it going by utilizing Javascript and yippee it was conceivable.

One capacity needs to snatch the replicated determination, attach a copyright notice and afterward add the two to the clipboard.

<script type="text/javascript">
function addLink() {
     var body_element = document.getElementsByTagName('body')[0];
     var selection;
     selection = window.getSelection();
     var pagelink = "<br /><br />Read more at: <a href='"+document.location.href+"'>"+document.location.href+"</a>"; 
     var copytext = selection + pagelink;
     var newdiv = document.createElement('div');
     newdiv.style.position='absolute';
     newdiv.style.left='-99999px';
     body_element.appendChild(newdiv);
     newdiv.innerHTML = copytext;
     selection.selectAllChildren(newdiv);
     window.setTimeout(function() {
     body_element.removeChild(newdiv);
     },0);
}
document.oncopy = addLink;
</script>

For Demo : Put the above script in head part and afterward simply duplicate any substance of your page and glue it in any editor.you will see an additional connection for read more connection is included at the base.

0 comments:

Post a Comment