开发者

Fmylife javascript copy-paste into link

开发者 https://www.devze.com 2022-12-22 16:24 出处:网络
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 autom

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 beh开发者_运维问答avior?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号