Use 2 files
ZeroClipboard. js
ZeroClipboard.swf
Copy codeThe Code is as follows:
<Script type = "text/javascript" src = "ZeroClipboard. js"> </script>
<Script language = "JavaScript">
Var clip = null;
Function $ (id) {return document. getElementById (id );}
Function init (xm ){
Clip = new ZeroClipboard. Client ();
Clip. setHandCursor (true );
Clip. addEventListener ('load', function (client ){
Debugstr ("Flash movie loaded and ready .");
});
Clip. addEventListener ('mouseover', function (client ){
// Update the text on mouse over
Clip. setText ($ ('txt _ links '). value );
});
Clip. addEventListener ('complete', function (client, text ){
Debugstr (xm );
});
Clip. glue ('d _ clip_button ', 'd _ clip_container ');
}
Function debugstr (msg ){
If (msg = '1 '){
Alert ('copied successfully, please paste it with Chrl + V ');
// Alert ('chushihu, please paste it with Chrl + V ');
} Else {
}
}
</Script>
Note: <body onload = "init (1);">