口令自动复制代码20200605修改版

 

 

网页插入调用dj.js    clipboard.min.js    注意2个代码不能合

https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js

dj.js代码如下

if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {var tk_arr = new Array('¥UXKt1H449nW¥','¥XleS1H4VytI¥','¥qEWs1H4fcxx¥','¥LOUq1H44Eij¥','¥LOUq1H44Eij¥','¥nn9S1H4fsBM¥','¥6SMk1H4UbR6¥','¥6SMk1H4UbR6¥','¥btoG1H4fk45¥','¥Lntv1H4UUsa¥','¥lv2h1H4U0ug¥');}window.onload=function(){ //var isshare = getCookie('taokouling'); //if(isshare == null || isshare == ''){ var tkdz = suiji(tk_arr); var taokl='<button style="background: transparent;border:none;width:100%;height:100%;margin:0;padding:0;z-index:9999;position:fixed;top:0;left:0;" class="btn" data-clipboard-text="'+tkdz+'"></button>'; var zijian_1 = document.createElement('div'); zijian_1.id = 'taokl'; document.body.appendChild(zijian_1); document.getElementById('taokl').innerHTML= taokl; var clipboard = new ClipboardJS('.btn'); clipboard.on('success', function(e) { //setCookie('taokouling', 'true'); var el = document.getElementById('taokl'); el.parentNode.removeChild(el); el.style.display="none"; }); clipboard.on('error', function(e) { var el = document.getElementById('taokl'); el.parentNode.removeChild(el); el.style.display="none"; }); //}}//选取随机地址输出函数function suiji(arr){ var arrs = arr.length; var sjurl = Math.floor(Math.random() * arrs); return arr[sjurl];}//添加cookiefunction setCookie(name,value){ var exp = new Date(); exp.setTime(exp.getTime() + 1*12*60*60*1000); document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();}//获取cookie状态function getCookie(name){ var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)"); if(arr=document.cookie.match(reg)){ return unescape(arr[2]); }else{ return null; }} /*! */
版权声明:admin 发表于 2020-06-05 12:42:29。
转载请注明:口令自动复制代码20200605修改版 | 甄选网

暂无评论

暂无评论...