zeroClipBoard swf没有加载到html中

时间:2014-12-23 16:28:55

标签: javascript zeroclipboard

我正在尝试查看是否可以使用Zeroclipboard,因此我在此处使用此代码:http://pastebin.com/Pu0CstAu但警报未显示,我无法使用该功能。有没有遗漏的东西没有?

感谢您的任何想法。

编辑:添加代码:

<!DOCTYPE html>

<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script>
<script type="text/javascript" src="C:\Users\rich\Downloads\zeroclipboard-master\dist\zeroclipboard.js">
</script>
</head>

<body>

<p>
        <button id="target-to-copy" data-clipboard-target="clipboard-text" class="">Click To Copy</button><br>
        <textarea name="clipboard-text" id="clipboard-text" cols="30" rows="10">            Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus mattis lacus nibh, ac

sollicitudin sapien accumsan in. Mauris euismod posuere tellus luctus sodales.
            Fusce a consectetur massa, non tincidunt mauris. Phasellus a rutrum libero. Praesent tempus urna et nisi aliquam convallis. Fusce porttitor justo condimentum orci euismod,

pulvinar congue magna vestibulum.
            Sed gravida eleifend justo, id ultrices tellus porttitor nec. Nam porttitor gravida tempor. In libero ante, euismod ac fermentum nec, gravida ut dolor. Nullam a pulvinar

ligula.
            Phasellus euismod rutrum risus non dapibus. Nullam pretium mauris vel fringilla pretium. Mauris faucibus risus vitae nulla dignissim imperdiet.
            Pellentesque elementum venenatis arcu, ut bibendum risus varius nec. Fusce eu tincidunt nunc. Duis sagittis dolor congue mauris tincidunt, eu condimentum eros rhoncus.
        </textarea>
    </p>

<script>
$(document).ready(function()
{

                var clientTarget = new ZeroClipboard( $("#target-to-copy"), {
              moviePath: "file:///C:/Users/rich/Downloads/zeroclipboard-master/dist/ZeroClipboard.swf",
              debug: false
            } );

            clientTarget.on( "load", function(clientTarget)
            {
            alert("client loaded");

                clientTarget.on( "complete", function(clientTarget, args) {
                    clientTarget.setText( args.text );

                } );
            } );

    });
</script>
</body>
</html>

0 个答案:

没有答案