How to update TinyMCE for code I add using JavaScript

I need to insert code for flash into TinyMCE with JavaScript. If I paste the same code using the TinyMCE HTML menu, it automatically adds a flash icon to the editor. But if I paste the code using JavaScript, the actual code is inserted, but nothing appears on the screen.

One trick I found is switching TinyMCE to a regular text area and back to TinyMCE. Then the flash icon is displayed. Is there a better way to do this?

Thanks.

Sam

+2


a source to share


2 answers


Try this code ...

var content = tinyMCE.get ('comment'). getContent () + "ur flash content";
tinyMCE.get ('comment'). setContent (content);



Since I don't know about flash. but using this way you can insert into tinymce

+2


a source


Have you tried using: mceRepaint?



http://wiki.moxiecode.com/index.php/TinyMCE:Commands

+1


a source







All Articles