Clipboard Copy | JavaScriptSource

Clipboard Copy

Mark O'Sullivan Jul 11, 2007

General

There are many scripts for copying text from a Web page that work fine in MS Internet Explorer but not in Firefox, Netscape, or Opera. This cross-browser script, however, will do the trick. It will copy a designated portion of text into the Windows clipboard, using a small Macromedia Flash file to perform the copy on the browser's behalf.



Notes

Source Code

Paste this source code into the designated areas.

External file

Paste this code into an external JavaScript file named: clipboardCopy.js


Head

Paste this code into the HEAD section of your HTML document.


Body

Paste this code into the BODY section of your HTML document


Other

Download the images using the URL below:

Leave a Response

(16 comments)

Sounds like you have JavaScript turned off in your browser.

Lee Jan 16, 2009

The Clipboard Copy sample as provided on this page doesn't work for me in firefox but it works for one of my coworkers using the same version of firefox. Any ideas why it's not working for me?[br /][br /]Thanks,[br /]Bruce

Bruce Dec 9, 2008

Thanks for posting this information. I was about to give up the copy to clipboard and show the url in small popup.[br /][br /]Then I came across your article[br /][br /]Thanks for your help

jagdish Jul 28, 2008

In order to better help you, you'll need to post your question [a href="http://www.webdeveloper.com/forum/forumdisplay.php?f=3"]over on the forums[/a].

Lee Jun 26, 2008

Hello,[br /][br /]In my case code is not working...[br /]It giving me error window is not define.[br /][br /]help me out![br /][br /]Thanks[br /]Paresh

Paresh Jun 5, 2008