N
N
neseti2014-10-30 13:18:47
JavaScript
neseti, 2014-10-30 13:18:47

Copy text button. What's wrong?

Most likely, the question is idiotic, I apologize in advance :)
I need to make a simple "copy text" button. On steamdev.com/zclip I found the simplest, it seems, option, but it does not work. What did I write wrong?
(the /js folder contains jquery.js files from here , jquery.zclip.js and ZeroClipboard.swf)

<html><head>	

<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.zclip.js"></script>
</head>
    <body>


<script>
$(document).ready(function(){
$('a#copy-description').zclip({
path:'js/ZeroClipboard.swf',
copy:$('p#description').text()
});
</script>
      
    <div >
    <a id="copy-description" href="#">скопировать</a><p id="description"> текст</p>
      
    </div>
    
      
      
  </body>
</html>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
#
# artur #, 2014-10-31
@passshift

By the way, in their example they use a different version of jquery ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery....
try with it

B
btc4youru, 2015-08-21
@btc4youru

abandoned the topic ... there you have brackets }); lacks

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question