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.

jmc
  • 131
  • 1
  • 3
  • 14
  • 2
    You want to click a button or link to copy *what* text to *what* element? Show your HTML, show us your JavaScript (attempts count for a lot): show us [*what you've tried*](http://whathaveyoutried.com/). – David says reinstate Monica Jun 04 '12 at 09:12
  • @DavidThomas i think he wants to copy text into the clipboard, not to another element. – Andy Jun 04 '12 at 09:15
  • 1
    I have not done any javascript for that function yet since i've no idea if it is really done in javascript. But the idea is just the same like on http://bit.ly. – jmc Jun 04 '12 at 09:16
  • 1
    Checkout http://stackoverflow.com/questions/400212/how-to-copy-to-the-clipboard-in-javascript – manuskc Jun 04 '12 at 09:17
  • 1
    http://stackoverflow.com/questions/1539641/copy-text-to-the-clients-clipboard-using-jquery – Andy Jun 04 '12 at 09:17

1 Answers1

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/

Christoph
  • 46,101
  • 18
  • 92
  • 121