【问题标题】:zclip within a function函数内的 zclip
【发布时间】:2013-12-19 21:42:20
【问题描述】:

我从未使用过 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);
}

你会如何解决这个问题?请与我分享。

【问题讨论】:

    标签: jquery zclip


    【解决方案1】:

    我刚刚做了这个

    prompt('Please copy this link to share', share_path);
    

    希望它也对你有用。

    【讨论】:

      猜你喜欢
      • 2023-03-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-06-18
      • 1970-01-01
      • 1970-01-01
      • 2012-10-05
      相关资源
      最近更新 更多