日期:2014-05-17  浏览次数:20466 次

定义了一个FCKeditor,如何获取它的值呢
尝试了好多方法都不行,下面是我的代码,请指正:
定义一个FCK:
<div><input type='hidden' id='FCKeditor1' name='FCKeditor1' value='' /><input type='hidden' id='FCKeditor1___Config' value='HtmlEncodeOutput=true' /><iframe id='FCKeditor1___Frame' src='fckeditor/editor/fckeditor.html?InstanceName=FCKeditor1&amp;Toolbar=Default' width='700px' height='400px' frameborder='no' scrolling='no'></iframe></div><tr/>
使用FCK
 var textarea1 = getEditorHTMLContents(('<%=FCKeditor1.ClientID %>').value);

提示:找不到FCKeditor1,换用FCKeditor1___Frame,也一样不行

------解决方案--------------------
var editor = FCKeditorAPI.GetInstance(Name); 
editor.EditorDocument.body.innerText;