Solved

Copy to clipboard script doesn't work in Firefox

Posted on 2012-04-04
5
425 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Best websites/companies to provide home mortgage equity loan 1 72
MCAT Verbal Reasoning 2 22
Natural height and jquery 6 41
Difference between Highcharts and Mapbox 10 45
An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

752 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