Paste in Firefox

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • J1C

    Paste in Firefox

    I have the following small function that pastes to a SPAN fine in IE
    .... but not so in FF:

    /*Paste onLoad()*/
    function paste(){
    document.getEle mentById('conte nt').focus();
    document.execCo mmand('Paste');
    }

    <!-- snip -->

    <span contenteditable id="content"></span>
    Any ideas on how to support 'contenteditabl e' in FF?

  • Randy Webb

    #2
    Re: Paste in Firefox

    J1C wrote:[color=blue]
    > I have the following small function that pastes to a SPAN fine in IE
    > .... but not so in FF:
    >
    > /*Paste onLoad()*/
    > function paste(){
    > document.getEle mentById('conte nt').focus();
    > document.execCo mmand('Paste');
    > }
    >
    > <!-- snip -->
    >
    > <span contenteditable id="content"></span>
    > Any ideas on how to support 'contenteditabl e' in FF?[/color]

    You can probably emulate contenteditable in FF but you can not emulate
    execCommand('Pa ste') as its another IE-only item. And emulating
    contenteditable would be a total nightmare in browsers that do not
    support it.

    --
    Randy
    comp.lang.javas cript FAQ - http://jibbering.com/faq

    Comment

    • Martin Honnen

      #3
      Re: Paste in Firefox



      J1C wrote:
      [color=blue]
      > <span contenteditable id="content"></span>
      > Any ideas on how to support 'contenteditabl e' in FF?[/color]

      There is currently no support for that, but FF as well as other Mozilla
      1.4 and later version provide editable iframes in a way meant to be
      compatible with editable iframes in IE 5 (and later) on Windows.
      For Mozilla look here:
      <http://www.mozilla.org/editor/midas-spec.html>
      <http://www.mozilla.org/editor/midasdemo/>
      IE's documentation for designMode is here:
      <http://msdn.microsoft. com/library/default.asp?url =/workshop/author/dhtml/reference/properties/designmode.asp>


      --

      Martin Honnen

      Comment

      Working...