复制到剪贴板的js代码(兼容ie、firefox、chorme、safari...什么都兼容!)
对于非ie浏览器他是用flash来实现的,js代码如下: < script type = " text/javascript " > function copy_code(copyText) { if (window.clipboardData) { window.clipboardData.setData( " Text " , copyText) } else { var flashcopier = ' flashcopier ' ; if ( ! document.getElementById(flashcopier)) { var divholder = document.createElement( ' div ' ); divholder.id = flashcopier; document.body.appendChild(divholder); } document.getElementById(flashcopier).innerHTML = '' ; var divinfo = ' <embed src="../js/_clipboard.swf" FlashVars="clipboard= ' + encodeURIComponent(copyText) + ' " width="0" height="0" type="application/x