Solved

Copy to clipboard script doesn't work in Firefox

Posted on 2012-04-04
5
407 Views
Last Modified: 2012-04-04
Seems like a pretty simple code. Works in Internet explorer 9, (although it asks if you want IE to access your clipboard), but doesn't work in FF 8.01:

<script language="JavaScript">
function cbwrite (s) { window.clipboardData.setData("Text", s); }
</script>
<input name="" type="text" id="txt" value="CB25" /><input type="button" onClick="cbwrite(txt.value);" value="copy to clipboard">

Second question is, if I use this twice or more times on one page, with different values, would it continue to work? Thanks! It is in use here: www.wheelsonmeals.net/test/
0
Comment
Question by:mel200
  • 3
  • 2
5 Comments
 
LVL 82

Expert Comment

by:leakim971
ID: 37808856
0
 

Author Comment

by:mel200
ID: 37808875
Ok, so that says it is a dumb idea and won't ever ever work. :)

But they do it here: http://www.retailmenot.com/

and that's sort of what I want to do. Any thoughts? Thanks!
0
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 37808935
It use Adobe Flash.
So you want to use Adobe Flash?
0
 

Author Closing Comment

by:mel200
ID: 37808948
Nope, I don't want to use flash. Thanks for your help! I got my answer.
0
 
LVL 82

Expert Comment

by:leakim971
ID: 37808959
You're welcome. See you later.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
Where to go on the main page to find the job listings. How to apply to a job that you are interested in from the list that is featured on our Careers page.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now