简体   繁体   English

链接将复制<a href>标签</a>

[英]A link that will copy the <a href> tag

i'm trying to produce a button or <a> link that will act like a or it will ctrl+c the given <a> on the specified <li> . 我试图产生一个按钮或<a>链接,其作用类似于a,或者它将ctrl + c在指定的<li>上给定的<a> Like the "Copy" button on url shorteners like bit.ly. 就像网址缩短工具上的“复制”按钮(如bit.ly)一样。 I just have no idea if this is done in jquery? 我只是不知道这是否在jquery中完成? Anyone have a copy of the code? 有人有代码副本吗? Thanks a lot. 非常感谢。

You need flash to copy something to the clipboard, because js is restricted for that matter (for security reasons). 您需要使用Flash才能将某些内容复制到剪贴板,因为js受此限制(出于安全原因)。 As you can see, bit.ly uses the same technique. 如您所见,bit.ly使用相同的技术。

IE is the only browser, which is capable of pasting to the clipboard with javascript. IE是唯一的浏览器,能够使用javascript粘贴到剪贴板。

jQuery-Plugin, that uses the flash-fallback: http://www.steamdev.com/zclip/ jQuery-Plugin,使用flash-fallback: http//www.steamdev.com/zclip/

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

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