How does a .com policy paste a hyperlink into copied text?

If you visit this article on politico.com, select part of the article’s text, then paste this text in another place, it will contain a link that says: "Read more at: ...". How it's done?

Update: this is JS, but hard to execute: http://tcr.tynt.com/javascripts/Tracer.js

+6
javascript
source share
2 answers

I assume that it looks like any copy in the script clipboard, but you paste the text “Read more at: ..” in front and listen to the oncopy event.

So, instead of just doing: window.clipboardData.setData ("Text", textToCopy);

would you do

window.clipboardData.setData ("Text", "More on: mysite.com", + textToCopy);

More details here:

http://www.daniweb.com/forums/thread53662.html

+7
source share

On politico.com, the code that does what you say is in tracer.js.

+1
source share

All Articles