views:

104

answers:

2

Possible Duplicates:
How to Copy to Clipboard in JavaScript?
How to copy text to clipboard in Firefox 3.5?

Hi,

A link has a anchor text, when i click on it, that anchor text should be copied to clipboard, and the link should open in new window. How can this be done in cross-browser way (especially firefox)? Thanks

A: 

You can't really do it with JavaScript but you can do it with flash (which you can trigger with JavaScript). The downside of that: If the user has no Flash plugin, it doesn't work.

Here is a script that does the trick: http://cfruss.blogspot.com/2009/01/copy-to-clipboard-swf-button-cross.html

Kau-Boy
I *can* be done without using Flash, see http://www.febooti.com/support/website-help/website-javascript-copy-clipboard.html
Marcel Korpel
OK, but telling your users (and only those who use Firefox), to change the hidden settings in the about:config is not really a solution.
Kau-Boy