tinyMCE 是一种用于在网页上编辑和格式化文本的 WYSIWYG(所见即所得)文本编辑器。 如果你想在初始化 tinyMCE 后修改它,你可以使用 tinyMCE 的 API 调用来修改它。
下面是一个示例,展示了如何使用 tinyMCE 的 API 来获取编辑器实例并修改它的配置选项:
tinymce.init({
selector: 'textarea',
...
});
// 获取tinyMCE实例
var editor = tinymce.get('mytextarea');
// 使用editor.settings API来修改tinyMCE实例的设置
editor.settings.readonly = true;
// 使用editor.setContent API来修改tinyMCE实例的内容
editor.setContent('This is the new content for the editor');
// 使用editor.execCommand API来执行命令
editor.execCommand('mceInsertContent', false, 'This is some new content');
请注意,在使用 tinyMCE API 之前,你需要确保已经在你的网页中包含了 tinyMCE 的 JavaScript 文件。
有关使用 tinyMCE API 的更多信息,请参阅 tinyMCE 的文档:https://www.tiny.cloud/docs/