I have a problem with the Cute File Browser and this script
On the Stackoverflow Page the copy to clipboard works but when I add the script into the cute file browser to copy the link on click it doesn't work and also the browser ignores the
e.preventDefault()
code. Can you please help me and say whats wrong?
so this is from the script.js with the added code:
// Clicking on breadcrumbs
breadcrumbs.on('click', 'a', function(e){
e.preventDefault();
var index = breadcrumbs.find('a').index($(this)),
nextDir = breadcrumbsUrls[index];
breadcrumbsUrls.length = Number(index);
//before it was window.location.hash instead of var cope
var cope = encodeURIComponent(nextDir);
var aux = document.createElement("input");
aux.setAttribute("type", "text");
aux.setAttribute("id", "temp");
aux.setAttribute("style", "position:absolute;opacity:0;");
aux.setAttribute("value", cope);
document.body.appendChild(aux);
aux.select();
document.execCommand("copy");
document.body.removeChild(aux);
});
what am I doing wrong?