-
copy to clipboard not working in firefox
hi
copy to clipboard not working in Firefox. i try but i cannot find solutions please help me.
actually i put this java script code
window.addEvent('domready', function() {
function sendtoclipboard(s,el) {
if( window.clipboardData && clipboardData.setData ) {
clipboardData.setData("text", s);
} else {
ffcopy(el);
}
}
function ffcopy(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;
}
}
$('copyBtn').addEvent('click',function() {
var el = $('copyMe');
el.select();
var t = el.getText();
sendtoclipboard(t,el);
});
});
and
this is the HTML code
<textarea id="copyMe" cols="50" rows="10" name="copyMe"></textarea>
<input id="copyBtn" name="copyBtn" type="button" value="Copy To Clipboard" />
-
-
sorry this is not working in firefox
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks