Connecting Tech Pros Worldwide Help | Site Map

Paste in Firefox

J1C
Guest
 
Posts: n/a
#1: Jul 23 '05
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?

Randy Webb
Guest
 
Posts: n/a
#2: Jul 23 '05

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
Guest
 
Posts: n/a
#3: Jul 23 '05

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/
Closed Thread


Similar JavaScript / Ajax / DHTML bytes