标签:rdd ext sel set int rgba turn app span
function addLink() { let body_element = document.body; let selection = window.getSelection(); let locationHref = document.location.href; let appendLink = "\r\n\r\n 原文出自[ ushowtime ] 转载请保留原文链接: <a href=‘" + locationHref + "‘>" + locationHref + "</a>"; if (window.clipboardData) { // Internet Explorer let copytext = selection + appendLink; window.clipboardData.setData("Text", copytext); return false; } else { let copytext = selection + appendLink; let newdiv = document.createElement(‘div‘); newdiv.style.position = ‘absolute‘; newdiv.style.left = ‘-99999px‘; body_element.appendChild(newdiv); newdiv.innerHTML = copytext; selection.selectAllChildren(newdiv); window.setTimeout(function() { body_element.removeChild(newdiv); }, 0); } }
标签:rdd ext sel set int rgba turn app span
原文地址:https://www.cnblogs.com/ushowtime/p/14878127.html