Connecting Tech Pros Worldwide Help | Site Map

Paste in Firefox

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 23rd, 2005, 05:28 PM
J1C
Guest
 
Posts: n/a
Default 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.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, 05:28 PM
Randy Webb
Guest
 
Posts: n/a
Default 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, 05:29 PM
Martin Honnen
Guest
 
Posts: n/a
Default 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/
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.