I have set up links that when clicked I want it to copy the text. It outputs many links so I have to make sure zClip copies the right one:
<a class="copy-callbacks" id="coupon-code-copy-<?php echo $couponid ; ?>" href="#"><?php echo $info['coupon'] ; ?></a>
This is the jQuery I am using but it is not working:
$(document).ready(function(){
$("a.copy-callbacks").zclip({
path:'scripts/ZeroClipboard.swf',
copy: $('#' + myCopyID).text(),
beforeCopy:function(){
var myCopyID = $(this).attr("id");
},
afterCopy:function(){
}
});
});
Using this code the flash object doesn't even load. I'm not quite sure what is going wrong. I've tried using:
copy: $(this).text(),
The flash object loads, but for some weird reason it copies some text in the footer. Any help is greatly appreciated!!
I've never had to use the .attr("id"), I always do the following.
Where PageInfo is a js object. Overall, id tags are different than the class tags, .swfTitle is different than #swfTitle.