Login or Sign up Help | Site Map
Connecting Tech Pros Worldwide

Paste in Firefox

Question posted by: J1C (Guest) on July 23rd, 2005 05:28 PM
I have the following small function that pastes to a SPAN fine in IE
.... but not so in FF:

/*Paste onLoad()*/
function paste(){
document.getElementById('content').focus();
document.execCommand('Paste');
}

<!-- snip -->

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

Would you like to answer this question?
Sign up for a free account, or Login (if you're already a member).
Randy Webb's Avatar
Randy Webb
Guest
n/a Posts
July 23rd, 2005
05:28 PM
#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.getElementById('content').focus();
> document.execCommand('Paste');
> }
>
> <!-- snip -->
>
> <span contenteditable id="content"></span>
> Any ideas on how to support 'contenteditable' in FF?[/color]

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

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

Martin Honnen's Avatar
Martin Honnen
Guest
n/a Posts
July 23rd, 2005
05:29 PM
#3

Re: Paste in Firefox


J1C wrote:
[color=blue]
> <span contenteditable id="content"></span>
> Any ideas on how to support 'contenteditable' 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
http://JavaScript.FAQTs.com/

 
Not the answer you were looking for? Post your question . . .
183,906 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Latest Articles: Read & Comment
  • Didn't find the answer you were looking for?
    Post Your Question
  • Top Community Contributors