问题
I am using zeroClipboard but I don't manage to have it working.
Here is my HTML markup:
<div id= 'd_clip_button'>
<img class = 'displayed' src="{{ asset('bundles/yopyourownpoet/images/CopyPoemPage8.png') }}" alt="Copy Poem" height="71" width="300" />
</div>
And the javascript:
<script src="{{ asset('bundles/yopyourownpoet/js/ZeroClipboard.js') }}" type="text/javascript"></script>
<script>
$(document).ready(function() {
ZeroClipboard.setMoviePath("{{ asset('bundles/yopyourownpoet/flash/ZeroClipboard.swf') }}");
var clip = new ZeroClipboard.Client();
clip.setText( "aaaa" );
clip.glue( 'd_clip_button' );
clip.addEventListener( 'onLoad', function(){ alert('loaded baby'); } );
});
</script>
I see the alert 'loaded baby'. However, I never have the text copied in my clipboard. I tried on local on my computer and on the server as well.
I also went to this page http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04a.html and autorized flash, but still not working.
What could I be doing wrong?
回答1:
If you are having troubles with zeroClipboard, you might want to give this jquery plugin a try: http://www.steamdev.com/zclip/
zclip is based on zeroClipboard. Easy to install & easy to use.
回答2:
FYI...ZeroClipboard project seems to still be active...just touched as of 2013.Aug.31: https://github.com/zeroclipboard/ZeroClipboard
And I have just successfully used it in my Visual Studio 2010 ASP.NET C# project using ASP controls. Cool! Bump!
来源:https://stackoverflow.com/questions/10569084/difficulty-with-zeroclipboard