Domanda

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.

È stato utile?

Soluzione

I just did this

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

Hope it'll also work for you.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top