我有一些textareas,它们都与tinyMCE。一个textarea与tinyMCE的setContent
我想设置特定textarea的内容,但我找不到如何。
我已经tryed这一点:
tinyMCE.get('title').setContent(selected_article_title);
这里是我的textarea:
<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
谢谢@Thariama,但这不适合我。我的textarea仍然是空的。 – 2012-08-03 06:17:23