I'm using this one /
I spent this whole day figuring out how to use ZeroClipboard(ZC). I even read the instructions: .md and followed it step by step and couldn't do it.
I tried again and again and again but I just can't get it to work. I even spent hours reading other guides at stackoverflow and other pages both just couldn't get this to work. Moreover, most of the answers are outdated.
Can anyone please write a simple working ZC code that copies a paragraph tag:
<p>Hello, I'm Armesh</p>
Then just tell me simply each part of the ZC code and why you wrote it that way.
I plan to use ZC to copy references generated by my generator: /
This is the code I wrote, all link references are correct:
<!DOCTYPE HTML>
<html>
<head>
<title>Zero Test</title>
<script src=".9.1/jquery.min.js"></script>
<script src="javascripts/ZeroClipboard.js"></script>
</head>
<script language="JavaScript">
$(document).ready(function() {
var clip = new ZeroClipboard($("#copy_button"), {
moviePath: "javascripts/ZeroClipboard.swf"
});
});
</script>
<body>
<button id='#copy_button' data-clipboard-target='to_copy'><b>Copy To Clipboard</b></button>
<p id='to_copy'>123456</p>
</body>
</html>
I also ran the code/web page above in Google Chrome, there are no errors log in the console. It's blank.
I'm using this one http://jonrohan.github.io/ZeroClipboard/
I spent this whole day figuring out how to use ZeroClipboard(ZC). I even read the instructions: https://github./jonrohan/ZeroClipboard/blob/master/docs/instructions.md and followed it step by step and couldn't do it.
I tried again and again and again but I just can't get it to work. I even spent hours reading other guides at stackoverflow and other pages both just couldn't get this to work. Moreover, most of the answers are outdated.
Can anyone please write a simple working ZC code that copies a paragraph tag:
<p>Hello, I'm Armesh</p>
Then just tell me simply each part of the ZC code and why you wrote it that way.
I plan to use ZC to copy references generated by my generator: http://anonoz./armesh/
This is the code I wrote, all link references are correct:
<!DOCTYPE HTML>
<html>
<head>
<title>Zero Test</title>
<script src="https://ajax.googleapis./ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="javascripts/ZeroClipboard.js"></script>
</head>
<script language="JavaScript">
$(document).ready(function() {
var clip = new ZeroClipboard($("#copy_button"), {
moviePath: "javascripts/ZeroClipboard.swf"
});
});
</script>
<body>
<button id='#copy_button' data-clipboard-target='to_copy'><b>Copy To Clipboard</b></button>
<p id='to_copy'>123456</p>
</body>
</html>
I also ran the code/web page above in Google Chrome, there are no errors log in the console. It's blank.
Share Improve this question edited Apr 4, 2013 at 14:45 Armesh Singh asked Apr 4, 2013 at 13:55 Armesh SinghArmesh Singh 4052 gold badges5 silver badges12 bronze badges 6- Can you post some details of what errors you are running into? There is nothing to go on here. – Mike Clark Commented Apr 4, 2013 at 13:57
- 1 Posted a sample code I wrote. Could you please take a look and tell me what's wrong? – Armesh Singh Commented Apr 4, 2013 at 15:05
- 2 I noticed you put a # in the ID of the button (in the HTML section), any reason for that? – Evan Parsons Commented Nov 28, 2013 at 13:14
- Thank you sir, I was so frustrated... The examples and API is so confusing – IGRACH Commented Nov 7, 2014 at 14:15
- Is this supported for all browsers ? – s_k_t Commented Jun 9, 2015 at 21:11
3 Answers
Reset to default 7Ok I got it working, I also think the code posted above by me is correct.
The problem was that I was testing on local, and browsers usually prevent flash from running locally. This is what caused it to fail despite the code being correct.
As a last resort, I uploaded to my web server and tried online, it worked fine.
So, always test ZeroClipboard online after uploading it to your Web Server.
There is a Bug in your Code! Look at the button id-attribute and delete the '#' !
And: If u want more than 1 Clipboard Button on the current Page use the class attribute instead of id.
It works fine now! ;)
You can test ZeroClipboard locally by adding the port 3000.
e.g. http://localhost:3000
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1743756215a4501807.html
评论列表(0条)