I have been searching for code for a long time today, but I can't change the code one by one. Obviously, many people say it is feasible. Why can't I do it here. Finally, I found some comments in an English blog post. Because I do not understand flash, the final practice is not yet available, but I can provide some ideas for the same confused students.
Copying to the clipboard is easy to implement in ie. You only need to use the function window. clipboardData. setData ("Text", varstring );
Helper House: http://www.bkjia.com/
The problem is how to implement it in firefox. Currently, there are two methods on the Internet.
First, it is rare to use firefox features. For more information, see https://developer.mozilla.org/en/using_the_clipboard. To use this method, you need to modify the default settings of firefox, which is very troublesome.
Second, use flash in Javaeye and Discuz! Is used in this way, it is said that the emergence of 05 years. The key to this method is to use the flash copy function.
<Embed src = "_clipboard.swf" FlashVars = "clipboard = '+ encodeURIComponent (s) + '"width =" 0 "height =" 0 "type =" application/x-shockwave-flash "> </embed>
Here, we use a clipboard.swf file. There are many ready-made files on the Internet that can be downloaded directly.
This is the two methods I have found. In comparison, the second method is definitely the first choice and has a wide range of applications. Unfortunately, all the code I found on the Internet is unavailable.
The reason is mentioned in the comment in this article: http://www.jeffothy.com/weblog/clipboard-copy/.after updating flash 10, users are prohibited to copy the content without clicking flash. The original method is invalid. The solution is to overwrite a transparent copy of flash (this is the method used by dz) on the button ), or directly use a copy button that uses flash (this method is used by Javaeye ).