いくつかのテキストエリアがあり、それらはすべて 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 Web サイトhttp://www.tinymce.com/wiki.php/API3:method.tinymce.Editor.setContentの例を使用しています。