How do I refresh TinyMCE for the code that I add with JavaScript

与世无争的帅哥 提交于 2019-12-12 18:36:47

问题


I need to insert code for flash to TinyMCE with JavaScript. If I insert the same code using HTML menu of TinyMCE, it automatically add flash icon to the editor. But if I insert the code using JavaScript, the actual code is inserted but it shows nothing on the screen.

One trick I found is toggle TinyMCE to normal textarea and back to TinyMCE. Then, it shows the flash icon. Is there a better way to do that?

Thanks.

Sam


回答1:


Try this code...

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

Since i dont know about flash. but using this way u can insert into tinymce




回答2:


Have u tried using:mceRepaint ?

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



来源:https://stackoverflow.com/questions/2680319/how-do-i-refresh-tinymce-for-the-code-that-i-add-with-javascript

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!