views:

352

answers:

1

I've been trying to embed a flash widget inside a rich text editor (http://code.google.com/p/lwrte/), by adding an tag to the iframe's HTML using mozilla's .insertHTML function (http://www.mozilla.org/editor/midas-spec.html), but for some reason it never shows up - using firebug i can see that the embed tag is there, but it has stripped out the closing tag.

any suggestions? how do other RTEs do this?

thanks

+1  A: 

IE and Firefox don't support Flash or any other plug-in inside an editable tag.

What other editors (Like TinyMCE or CKEditor) do is that they insert a placeholder image that gets replaced by the corresponding object/embed tags when the form is been submitted.

For example, the placeholder image for CKEditor looks like this:

<img class="cke_flash"
    src="http://ckeditor.com/apps/ckeditor/3.0.1/images/spacer.gif?t=99GE"
    _cke_realelement="%3Ccke%3Aobject%20codebase%3D%22http%3A%2F(...)"
    alt="Flash Animation" _cke_real_element_type="flash"
    _cke_resizable="true"/>

As you can see they urlencode the entire object tag in the _cke_realelement attribute.

Julio César