Solved

Copy to clipboard script doesn't work in Firefox

Posted on 2012-04-04
5
403 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Stuck in voice control mode on your Amazon Firestick?  Here is how to turn it off!!!
"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

760 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

22 Experts available now in Live!

Get 1:1 Help Now