Click here to Skip to main content
16,009,598 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
C#
$(".mydivclass").live('click', function (e) {
//set path
ZeroClipboard.setMoviePath('ZeroClipboard.swf');

//create client
var clip = new ZeroClipboard.Client();

clip.setText(heading);

//glue it to the button
clip.glue('mydivid');
});


I am trying to copy text from a website (on firefox) using above code but its not copying on click..:-(
Posted
Comments
Have you included ZeroClipboard.js?
NeerajGSoft 28-Jan-14 1:32am    
yup i included..

 
Share this answer
 
Comments
NeerajGSoft 28-Jan-14 2:58am    
i gone through to this link but this one also not helpful to me..
C#
ZeroClipboard.setDefaults({ moviePath: "ZeroClipboard-master/ZeroClipboard.swf" })
$(".copyoption1").live('click', function (e) {
        if (window.clipboardData) // Internet Explorer
        {
            window.clipboardData.setData("Text", selection);
            $(".copyoptions").hide();
        }
        else {
            var clip = new ZeroClipboard($(".copyoption1"));
            clip.on('mousedown', function (client) {
                clip.setText("My Text");
            });
        }
});



I used this code and place my webpage with css and javascript files on server not on local then it worked..:-)
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900