如何为使用 JavaScript 添加的代码刷新 TinyMCE [英] How do I refresh TinyMCE for the code that I add with JavaScript
问题描述
我需要使用 JavaScript 将闪存代码插入 TinyMCE.如果我使用 TinyMCE 的 HTML 菜单插入相同的代码,它会自动将 flash 图标添加到编辑器.但是,如果我使用 JavaScript 插入代码,则插入了实际代码,但在屏幕上不显示任何内容.
我发现的一个技巧是将 TinyMCE 切换到普通 textarea 并返回到 TinyMCE.然后,它显示闪光灯图标.有没有更好的方法来做到这一点?
谢谢.
山姆
试试这个代码...
<前>var content=tinyMCE.get('comment').getContent()+"你的闪存内容";tinyMCE.get('comment').setContent(content);<小时>
因为我不知道闪存.但是使用这种方式你可以插入tinymce
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
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
这篇关于如何为使用 JavaScript 添加的代码刷新 TinyMCE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!