<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>