I never used zclip but after googling knew how to call zclip.
$("#copy").zclip({
path: "js/ZeroClipboard.swf",
copy: function(){
return $(this).prev().val();
}
});
But I have many buttons, they are working as share buttons. Clicking any button a function gets executed. I have to copy a string within the function.
function copy(commentId){
var share_path = window.location.protocol + window.location.host + window.location.pathname + '#';
share_path += <?='"'.$sharePath.'"';?> + commentId;
//copy the string share_path
alert(share_path);
}
How would you solve this? Please share with me.
I just did this
Hope it'll also work for you.