Connecting Tech Pros Worldwide Help | Site Map

Paste in Firefox

  #1  
Old July 23rd, 2005, 06:28 PM
J1C
Guest
 
Posts: n/a
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?

  #2  
Old July 23rd, 2005, 06:28 PM
Randy Webb
Guest
 
Posts: n/a

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
  #3  
Old July 23rd, 2005, 06:29 PM
Martin Honnen
Guest
 
Posts: n/a

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 Threads
Thread Thread Starter Forum Replies Last Post
svg in firefox webmaniac answers 1 November 5th, 2008 01:35 AM
problem in firefox browser muniarcot answers 2 March 14th, 2007 01:13 PM
Simple <div onclick=""> not working in firefox Eric-Sebastien Lachance answers 10 October 22nd, 2005 08:55 AM
Problem with clearing floats in Firefox Niels answers 18 July 21st, 2005 01:00 AM