Zclip working on jsfiddle but not working locally?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 01:43:39

问题


Its strange ::

Jsfiddle : http://jsfiddle.net/sxeCM/4/ [ Working ]

Locally having the same code :

<html>
    <head>
    </head>
    <body>
    <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
    <script src="http://www.steamdev.com/zclip/js/jquery.zclip.min.js"></script>
    <script>
    $(document).ready(function() {
        $('a#copy').zclip({
            path:'http://www.steamdev.com/zclip/js/ZeroClipboard.swf',
            copy:$('div#description').text()
        });
    });
    </script>
    <a id='copy' href="#">Copy</a>
    <div id='description'>this seems awesome</div>
    </body>
</html>

Its not working locally but working as expected on jsfiddle. What am I doing wrong ?


回答1:


Sounds like one of those security restrictions against file:/// URLs. I recently played with desktop notifications in Webkit, and they just won't launch on local files, but would work fine if the file was accessed over http://.



来源:https://stackoverflow.com/questions/13330472/zclip-working-on-jsfiddle-but-not-working-locally

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