I think your code should just read
$(document).ready(function() {
$("textarea").zclip({
path: "/assets/ZeroClipboard.swf",
copy: function () {
return $(this).val();
},
afterCopy: function() {
$(this).select();
}
});
});
- Why would you call zclip everytime you click on a textarea?
- No need for extraneous returns, the only one that may be doing something is the click one, except that there is no default action for clicking on a textarea
- The
copy
config option should use a function so it can return the current value of the textarea, not the initial value
The examples on the page show applying zclip
to another element, it will copy when you click that element, not the textarea, you'll have to dig into that.