I want to try this DEMO to copy text to the clipboard by using ZeroClipboard. I have one local folder with the index.html, ZeroClipboard.js and ZeroClipboard.swf int it. but it does not work:
<html>
<body>
<script type="text/javascript" src="ZeroClipboard.js"></script>
<script type="text/javascript">
//set path
ZeroClipboard.setMoviePath('ZeroClipboard.swf');
//create client
var clip = new ZeroClipboard.Client();
//event
clip.addEventListener('mousedown', function () {
clip.setText(document.getElementById('box-content').value);
});
clip.addEventListener('complete', function (client, text) {
alert('copied: ' + text);
});
//glue it to the button
clip.glue('copy');
</script>
<textarea name="box-content" id="box-content" rows="5" cols="70">
The David Walsh Blog is the best blog around! MooTools FTW!
</textarea>
<br />
<br />
<p>
<input type="button" id="copy" name="copy" value="Copy to Clipboard" />
</p>
</body>
</html>
You have to run a server. Because the link to you site must contain http or https. It's because of adobe flash's security settings