对于非ie浏览器他是用flash来实现的,js代码如下: 复制代码 代码如下: <BR>function copy_code(copyText) <BR>{ <BR>if (window.clipboardData) <BR>{ <BR>window.clipboardData.setData("Text", copyText) <BR>} <BR>else <BR>{ <BR>var flashcopier = 'flashcopier'; <BR>if(!document.getElementById(flashcopier)) <BR>{ <BR>var divholder = document.createElement('div'); <BR>divholder.id = flashcopier; <BR>document.body.appendChild(divholder); <BR>} <BR>document.getElementById(flashcopier).innerHTML = ''; <BR>var divinfo = '<embed src="../js/_clipboard.swf" FlashVars="clipboard='+encodeURIComponent(copyText)+'" width="0" height="0" type="application/x-shockwave-flash">'; <BR>document.getElementById(flashcopier).innerHTML = divinfo; <BR>} <BR>alert('copy成功!'); <BR>} <BR> 那个flash文件从这里下载:下载