YUI Rich Text Editor 小記

因為有打算用YUI RTE 來做default 的editor
不過因為有想要在textarea 裡面加入content 的須求
用document.post_form.post_text.value
會沒辦法在”所見即所得模式”下有反應
只能在原始碼模式下有作用

翻了一下文件
要用cmd_inserthtml來做
如下

myEditor = YAHOO.widget.EditorInfo.getEditorById('post_text');
myEditor.execCommand('inserthtml', document.post_form.post_text.value);

這樣應該就搞定了…

About johnpupu

..........
This entry was posted in program and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word