Results 1 to 2 of 2

Thread: copy to clipboard not working in firefox

  1. #1
    Join Date
    May 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default 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" />

  2. #2
    Join Date
    May 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    sorry this is not working in firefox

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •