Tinymce内容清除mceCleanup(Tinymce content clear mceCleanup)

编程入门 行业动态 更新时间:2024-10-10 09:23:00
Tinymce内容清除mceCleanup(Tinymce content clear mceCleanup)

我想清除tinymce内容并添加新内容。 我尝试使用下面的代码,但它追加到旧内容。 如何从tinymce中清除现有的内容。

tinymce.activeEditor.execCommand('mceCleanup'); tinymce.activeEditor.execCommand('mceInsertContent', false, result.content);

I want to clear tinymce content and add new content. i tried with following code but its getting append to the old content. how can clear the existing content from tinymce.

tinymce.activeEditor.execCommand('mceCleanup'); tinymce.activeEditor.execCommand('mceInsertContent', false, result.content);

最满意答案

使用 :

tinyMCE.activeEditor.setContent('');

将指定的内容设置为编辑器实例,这将在使用不同的清理规则选项设置之前清理内容。

参考: TinyMce

希望能帮助到你。

Use :

tinyMCE.activeEditor.setContent('');

Sets the specified content to the editor instance, this will cleanup the content before it gets set using the different cleanup rules options.

Reference:TinyMce

Hope it helps.

更多推荐

本文发布于:2023-04-29 03:10:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1334437.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:内容   Tinymce   mceCleanup   clear   content

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!