zeroclipboard not working

笑着哭i 提交于 2019-12-01 12:37:37

Are you running from a local file on disk? As it says here, Zero Clipboard might not work from local disks due to the security restrictions placed by Adobe. You may need to have an http:// or https:// url.

You can work around this by going here and adding the path to your local "ZeroClipboard.swf" file to the trusted files list. You could also try the "allow all" option.

Having said the above, when I installed it in my dev environment I didn't do any of that!! I just tested it using the "Complete Example" provided in the wiki instructions. I stuck the .swf file in the same directory as the webpage itself and it worked fine. Maybe try a simplified cut-and-paste test first up.

The demo example also has function(client){... where you just have function(){... for your addEventListener handlers. That would probably explain why you get no alerts for onMouseDown and onComplete, although I'm not sure why the alert worked for the onLoad.

for me it works when I init the zeroclipboard client on document ready

...
<script>
    $(document).ready(function() {
        var client = new ZeroClipboard($('#buttonId'), {
            moviePath : 'util/ZeroClipboard.swf'
        });
    });
</script>
...

will copy in cplipboard the contents of the input text, for me it worked also for localhost

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