2012-06-04 5 views
0

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>. Like the "Copy" button on url shorteners like bit.ly. I just have no idea if this is done in jquery? Anyone have a copy of the code? Thanks a lot.복사 할 링크 <a href> tag

+2

버튼이나 링크를 클릭하여 * what * 텍스트를 * what * 요소로 복사 하시겠습니까? HTML을 표시하고 자바 스크립트 (많은 시도 횟수)를 보여주십시오 : 우리에게 * 시도한 것을 * 표시하십시오 (http://whathaveyoutried.com/). –

+0

@DavidThomas 그는 다른 요소가 아니라 클립 보드에 텍스트를 복사하려고한다고 생각합니다. – Andy

+1

나는 자바 스크립트에서 실제로 수행되는지 전혀 모르기 때문에 그 함수에 대한 자바 스크립트를 아직 수행하지 않았다. 그러나이 아이디어는 http://bit.ly과 똑같습니다. – jmc

답변

0

You need flash to copy something to the clipboard, because js is restricted for that matter (for security reasons). As you can see, bit.ly uses the same technique.

IE is the only browser, which is capable of pasting to the clipboard with javascript.

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