如何为使用 JavaScript 添加的代码刷新 TinyMCE [英] How do I refresh TinyMCE for the code that I add with JavaScript

查看:27
本文介绍了如何为使用 JavaScript 添加的代码刷新 TinyMCE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆