views:

72

answers:

1

Fmylife.com has a nifty feature that when you copy the text from a post, it actually copies a LINK (html) so that when you paste it into your email/facebook/instant messenger/twitter/whatever it automatically will link to the post, giving them more traffic and more page views and more ad revenue, etc.

I looked into their javascript files but can't seem to find how they do it. How would one go about copying this behavior?

+1  A: 

The text in a post is actually an anchor <a> with CSS modified text-decoration: none. So , it looks like normal text, but indeed is a hyperlink.
So, when you click on it, you are redirected to the permalink of the post. Hence the behaviour.

N 1.1