I'd like to make it that when someone copies something from my site, it's automatically added to the content copied from the source, for example:
source: myite.com
I'd like to make it that when someone copies something from my site, it's automatically added to the content copied from the source, for example:
source: myite.com
Use the code below (removed 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: It does not work in Internet Explorer!