YUI Rich Text Editor 小記

November 17, 2008

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

翻了一下文件
要用cmd_inserthtml來做
如下
[sourcecode language='js']
myEditor = YAHOO.widget.EditorInfo.getEditorById(‘post_text’);
myEditor.execCommand(‘inserthtml’, document.post_form.post_text.value);
[/sourcecode]
這樣應該就搞定了…

tags:
posted in program by johnpupu

Follow comments via the RSS Feed | Leave a comment | Trackback URL

Leave Your Comment

*
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

 
Powered by Wordpress and MySQL. Theme by Shlomi Noach, openark.org