The role of Window.clipboarddata is to copy what is needed on the page to the Clipboard, providing access to the predefined Clipboard formats for use in editing operations.
three methods (1) cleardata (Sdataformat) removes data from the Clipboard in the specified format. Sdataformat: "text", "url" (2) GetData (Sdataformat) Gets the data in the specified format from the Clipboard. Sdataformat: "text", "url" (3) SetData (Sdataformat, sData) gives the Clipboard the data in the specified format. Returns true to indicate that the operation was successful. Sdataformat: "text", "url", "File", "html", "image", SData: Clip Data But this object is for IE only. If it is another browser, it will not be used
for other browsers, have to use the function of Flash, now online someone wrote a zeroclipboard.js, Zeroclipboard.swf, as long as the two files to make the relevant changes on the line: You can achieve any browser replication, of course, the browser to support Flash plugin line! The principle of this method is to overwrite a DOM element such as a button or div on a transparent flash (invisible to the user), and when you click the DOM, the actual click Is Flash, which accesses the clipboard of the Flash. Browser support: Firefox/ie/opera/chorme/safarizeroclipboard.js related code: Https://github.com/zeroclipboard/zeroclipboard