When copying url automatically

I saw on several sites that when you copy some text and paste it, it will add the URL of the page from where I copied the text.

For example:

This is text I copied. 

and when I insert, I get:

 This is text I copied. Read more: http://example.com/abc/def 

I'm just curious to know how this is done? How to add additional text to copied text?

Example. Check this question (or any other) on answer.com. Copy the question text and paste. Tested with the latest version of Firefox.

+8
html
source share
2 answers

There are many online tools that provide this and other site / blog management utilities. Answer.com also uses one such service called tynt . Open the link, scroll down and you will see answer.com in selected clients;). For more information.

+4
source share

Zeroclipboard should help you change the contents of the clipboard. This is a flash movie that is hidden in the browser and provides a JavaScript API for accessing the buffer.

Example.

 var clip = new ZeroClipboard.Client(); clip.addEventListener('complete', function(client, text) { clip.setText(text + "Read more at www."); }); 
+1
source share

All Articles