我从未使用过 zclip,但在谷歌搜索后知道如何调用 zclip。
$("#copy").zclip({
path: "js/ZeroClipboard.swf",
copy: function(){
return $(this).prev().val();
}
});
但是我有很多按钮,它们用作共享按钮。单击任何按钮,一个函数就会被执行。我必须在函数中复制一个字符串。
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);
}
你会如何解决这个问题?请与我分享。