日期:2014-05-16  浏览次数:20552 次

fckeditor 在前台页面里如何获取,从数据库里取到的值?
这个页面里这样的

    <FCK:editor id="info_demo" basePath="../fckeditor/" width="100%" height="500"
 toolbarSet = "Default" >          
    </FCK:editor>
    <input type="hidden" name="info_demo" value="">
    <script language="javascript" type="text/javascript">
         var oEditor = FCKeditorAPI.GetInstance('info_demo') ;
         var str = oEditor.GetXHTML();
         form.info_demo.value=str;
     </script>


我从数据库里取得一个"info_demo"值,如何能把它返回到页面上?

我曾把取到的值写到下面"X"的地方,但是显示出来的都是html代码,我想可能这个方法不对.
<FCK:editor id="info_demo" basePath="../fckeditor/" width="100%" height="500" toolbarSet = "Default" > 
X       
</FCK:editor>
这个问题如何解决?

修正:

String con = (String) request.getAttribute("content");

 <td colspan="5">
    <textarea id="content" name="content" style="WIDTH: 100%; HEIGHT: 400px"><%=con%>
     </textarea>
     <script type="text/javascript">
        var oFCKeditor = new FCKeditor('content') ;
        oFCKeditor.BasePath = "../../fckeditor/" ;
        oFCKeditor.Height = 500;
        oFCKeditor.ToolbarSet = "Default";         
        oFCKeditor.ReplaceTextarea();		 	         
      </script></td>

methed B: ADD+
 
<script type="text/javascript" src="../../fckeditor/fckeditor.js"></script> 

      <td colspan="5"><textarea id="content" name="content" style="WIDTH: 100%;
 HEIGHT: 400px"></textarea>
        <script type="text/javascript">
           var oFCKeditor = new FCKeditor('content') ;
           oFCKeditor.BasePath = "../../fckeditor/" ;
           oFCKeditor.Height = 500;
           oFCKeditor.ToolbarSet = "Default";         
           oFCKeditor.ReplaceTextarea();		 	         
         </script>        
       </td>
1 楼 xly_971223 2008-03-14  
FCK:editor 有没有个value属性
2 楼 lsk 2008-03-14  
你用Fck 的时候有一个 textarea ..
把从数据库得到的值赋给这个textarea 就好了.
3 楼 6er1 2008-03-14  
<pre name='code' class='html'>&lt;fck:editor id="doc" basePath="${ctx}/fck/" width="800px" height="500px"&gt;
${doc}
&lt;/fck:editor&gt;</pre>? 这样就行了<p>?</p>