我有一些带有tinyMCE的文本框。
我想要设置特定文本框的内容,但是我找不到方法。
我尝试了以下代码:
tinyMCE.get('title').setContent(selected_article_title);
这是我的文本框:
<textarea style="width: 95%;" name="Title" id="title"></textarea>
以下是我的 tinyMCE 初始化代码:
tinyMCE.init({
// General options
mode : "specific_textareas",
theme : "advanced",
width: "100%",
plugins : "pagebreak,paste,fullscreen,visualchars",
// Theme options
theme_advanced_buttons1 : "code,|,bold,italic,underline,|,sub,sup,|,charmap,|,fullscreen,|,bullist,numlist,|,pasteword",
theme_advanced_buttons2 :"",
theme_advanced_buttons3 :"",
theme_advanced_buttons4 :"",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
valid_elements : "i,sub,sup",
invalid_elements : "p, script",
editor_deselector : "mceOthers"
});
我不知道为什么这不起作用,我正在使用来自tinyMCE网站的示例 http://www.tinymce.com/wiki.php/API3:method.tinymce.Editor.setContent。