简体   繁体   English

Fmylife JavaScript复制粘贴到链接

[英]Fmylife javascript copy-paste into link

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. Fmylife.com具有一个漂亮的功能,当您从帖子中复制文本时,它实际上会复制一个LINK(html),以便当您将其粘贴到您的电子邮件/ facebook /即时通讯程序/推特/任何内容中时,它将自动链接到该帖子,从而为他们带来更多点击量,更多页面浏览量和更多广告收入等。

I looked into their javascript files but can't seem to find how they do it. 我查看了他们的javascript文件,但似乎找不到他们的操作方式。 How would one go about copying this behavior? 如何复制这种行为?

The text in a post is actually an anchor <a> with CSS modified text-decoration: none . 帖子中的文本实际上是锚定<a>具有CSS修改后的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. 因此,行为。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM