The implementation steps are as follows:
1-reference the file. After the download, two core files, zeroclipboard.js and zeroclipboard.swf, will be obtained, and one of them will be referenced in the project.
<SCRIPT type = "text/JavaScript" src = "http://www.cnblogs.com/Scripts/ZeroClipboard/ZeroClipboard.js"> </SCRIPT>
2-load the zeroclipboard object and implement the copy function.CopyCodeThe Code is as follows: // this step is very important. Set the Reference Path of the flash file.
Zeroclipboard. setmoviepath ('HTTP: // www.cnblogs.com/scripts/zeroclipboard/zeroclipboard.swf ');
// Create a zeroclipboard object
Clip = new zeroclipboard. Client ();
Clip. sethandcursor (true );
// Load the event. In the Mouseover event, upload the content to be copied to the flahs file for storage.
Clip. addeventlistener ('mouseover', function (client ){
Clip. settext ($ ('# indinfo'). Val ());
});
// A dialog box is displayed after the copy is successful.
Clip. addeventlistener ('complete', function (client, text ){
Alert ("Copied text to clipboard: \ n" + text );
});
// Specifies the object that implements the copy function.
Clip. Glue ('copy ');
// The following is the HTML object used
<% = Html. Hidden ("indinfo", viewdata ["indinfoformat"]. safestring () %>
<Input type = "button" value = "Copy to clipboard" id = "copy" name = "copy"/>
3-for local debugging and flash-based security mechanisms, some settings are required.
Http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04a.html
Enter the physical path of the Flash file on the webpage.
Http://www.jb51.net/jiaoben/28907.html