views:

345

answers:

2

I wonder how the http:j.mp can use the auto copy function. Please help me!

A: 

They use Flash to copy to clipboard.

<embed 
 width="46" 
 height="26" 
 type="application/x-shockwave-flash" 
 src="/static/CopyClipboardButton.swf?v=3.0" 
 flashvars="copyTextContainerId=short_url&amp;fontSize=14&amp;fontFace=Helvetica&amp;fontColor=#555555&amp;imageUrl=http://j.mp/static/images/index_copy_button_bento_dark.jpg&amp;amp;copyText=" 
 wmode="transparent"/>
Sam
please give me complete source code. For an example, i want to copy this text: bla bla bla. Can you give me the full code please?
Heypy.com
+1  A: 

Flash is the only solution i think (at least, when I looked for the same solution a few years ago). Here is a complete example and some interesting comments. You should find what you need.

Baztoune
As a complement : ZeroClipboard seems to be a recent and serious project and has a complete documentation, and some working examples.http://code.google.com/p/zeroclipboard/
Baztoune
what is the full URL for: <embed src="/zeroclipboard.js"> ?
Heypy.com
Everything's here http://code.google.com/p/zeroclipboard/wiki/Instructions It is a library so you have to import it, then declare a "client" in your javascript function, and save text using client.setText(YourSelection). I can't make it magic.
Baztoune

related questions