3
I would like to make that when someone copies something from my site, automatically be added to the copied content the source, for example:
source: meusite.com
3
I would like to make that when someone copies something from my site, automatically be added to the copied content the source, for example:
source: meusite.com
2
Use the code below (removed of this topic):
function addLink() {
var body_element = document.getElementsByTagName("body")[0];
var selection = window.getSelection();
var pagelink = '\n\nMai multe Bancuri pe: http://bancuricubarbatisifemei.blogspot.com/\n';
var copytext = selection + pagelink;
var newdiv = document.createElement('pre');
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);
}
document.oncopy = addLink;
Note: Does not work in Internet Explorer!
It has to work on IE too!
Browser other questions tagged javascript jquery
You are not signed in. Login or sign up in order to post.
http://www.scriptbrasil.com.br/forum/topic/113753-copiar-para-area-de-transferencia/
– Marcelo Bezerra bovino