| |
第一步:制作下载copy.js文件,内容如下:
// 自动 COPY 代码开始
function MM_findObj(n, d) { //v4.0 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i for(i=0;!x&&d.layers&&i if(!x && document.getElementById) x=document.getElementById(n); return x; } function JM_cc(ob){ var obj=MM_findObj(ob); if (obj) { obj.select();js=obj.createTextRange();js.execCommand("Copy");} alert("已经复制,可以在其他任何地方粘贴了!"); }
// 自动 COPY 代码结束
第二步:在需要的地方添加: 实际应用请根据自己的文件路径做具体调用 |