difficulty with zeroClipboard

别说谁变了你拦得住时间么 提交于 2019-12-11 03:49:13

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!