Hey all,
I'm trying to implant something in my blog and i hope you can help me.
I want my readers to have the option to click a button \ link like the trackback one and that the post link - URL will be automatically copied to their clipboard (like you see on imageshack, photobucket, TinyPic etc')
I've managed to find a code that does just that but its written in javascript. Due to today security in browsers you need to use a swf file in order for it to work.
Here's the code:
and the swf file:
how can i use the script above to copy my current url?
Thanks
I'm trying to implant something in my blog and i hope you can help me.
I want my readers to have the option to click a button \ link like the trackback one and that the post link - URL will be automatically copied to their clipboard (like you see on imageshack, photobucket, TinyPic etc')
I've managed to find a code that does just that but its written in javascript. Due to today security in browsers you need to use a swf file in order for it to work.
Here's the code:
Code:
function copy(inElement) {
if (inElement.createTextRange) {
var range = inElement.createTextRange();
if (range && BodyLoaded==1)
range.execCommand('Copy');
} else {
var flashcopier = 'flashcopier';
if(!document.getElementById(flashcopier)) {
var divholder = document.createElement('div');
divholder.id = flashcopier;
document.body.appendChild(divholder);
}
document.getElementById(flashcopier).innerHTML = '';
var divinfo = '<embed src="_clipboard.swf" FlashVars="clipboard='+encodeURIComponent(inElement.value)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>';
document.getElementById(flashcopier).innerHTML = divinfo;
}
}
and the swf file:
how can i use the script above to copy my current url?
Thanks