Copy to Clipboard Problem

Discussion in 'jQuery' started by GeekyGirl, Apr 11, 2013.

  1. #1
    hey,
    i have got a code for copy to clipboard using zeroclipboard and jquery.
    But for some reason it is not working.
    Help needed...
    Here's the code :
    <script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript" src="js/jquery.zclip.js"></script>

    <body>
    <a href="#" id="copy">Click Here</a>
    <p id="description">i have been copied</p>

    <script type="text/javascript">
    $(document).ready(function(){
    $('#copy').zclip({
    path:'js/ZeroClipboard.swf',
    copy: $('#description').text()
    });
    });
    </script>
    </body>

    Onclicking the link *click here* that text in <p> should get copied to clipboard

    here are the links of js source files :
    jquery.zclip.js : http://www.steamdev.com/zclip/js/jquery.zclip.js
    zeroclipboard.swf : http://zeroclipboard.googlecode.com/svn-history/r10/trunk/ZeroClipboard.swf
     
    Last edited: Apr 11, 2013
    GeekyGirl, Apr 11, 2013 IP
  2. Basti

    Basti Active Member

    Messages:
    625
    Likes Received:
    6
    Best Answers:
    3
    Trophy Points:
    90
    #2
    I myself used this one not to long ago, and it does look right. Are you sure the paths to the js and swf are correct?
     
    Basti, Apr 11, 2013 IP
  3. GeekyGirl

    GeekyGirl Greenhorn

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #3
    hey ..yes the code and paths where right
    just that this code works only when hosted... :|
    so for me it worked wen i hosted it
    Thanks.
     
    GeekyGirl, Apr 12, 2013 IP