Sun Dial Menu
Read More in Copy & Paste
Menu Read More
 

Read more at:

A largely ineffective technique used by some websites. This page was prompted when I was researching information on the suppression of keywords from Google Analytics reports.

I am not suggesting that you do this on your website when I first came across the technique I wondered how it was done. I now know and I am curious to analyse the code.

I say that this is ineffective as anyone copying text from a website so that they can copy it to their own website will see that there is a URL embedded when they paste the text into their own document. If the text is pasted into a blog or a Social Media post then it is likley to have a rel="nofollow" attribute added to the URL hyperlink. This is because the administrators of blogs and sites that allow users to add content are aware that this is a way of websites attempting to add links to themselves (Back Links) into other websites with the purpose of getting incoming links. If this was allowed then the page ranking of the site the link (copied text) is inserted into.

Top

How this is done

After looking at a few solutions found on the Internet, the code referenced on Stackoverflow is shown below:

The JavaScript for the addition of the URL

<script>
function addLink() {
//Get the selected text and append the extra info
var selection = window.getSelection(),
pagelink = '<br /><br /> Read more at: ' + document.location.href,
copytext = selection + pagelink,
newdiv = document.createElement('div');

//hide the newly created container
newdiv.style.position = 'absolute';
newdiv.style.left = '-99999px';

//insert the container, fill it with the extended text, and define the new selection
document.body.appendChild(newdiv);
newdiv.innerHTML = copytext;
selection.selectAllChildren(newdiv);

window.setTimeout(function () {
document.body.removeChild(newdiv);
}, 100);
}

document.addEventListener('copy', addLink);
</script>

This code only works when run from the Internet - a local copy will not have a URL


How to copy just the URL of a page to the clipboard

Judging by the Impressions that I get for this page it would seem that those that are searching are just trying to copy the URL of a web page to the clipboard. This is really easy and not the topic that I discuss on this page.

The best way to copy a URL is to do so from the URL box in your browser.

Links

External Links Disabled.

tempusfugit.me.uk is a non-commercial website. No payment or benefit is gained by the placement of links toother websites.

The External link is disabled to on this page, please visit other pages

Unlike most genealogical research websites tempusfugit.me.uk does not attempt to get you to "sign-up" when you click on one of their links.

This Wikipedia link is disabled.

The link on Wikipedia was to:

External Links Disabled.

tempusfugit.me.uk is a non-commercial website. No payment or benefit is gained by the placement of links to other websites.

The External link is disabled to on this page, please visit other pages

Top

External Links - references

Site design by Tempusfugit Web Design -