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.
更多推荐
发布评论