赋值问题,继续在线等。

yehanyy 2010-06-07 02:39:19
我从库中取出之前用FCKEDITOR存进去的内容,请问现在要怎么才能把取出来的内容赋值到<FCK:editor>中啊,我用value=""试过了,引号中的所有值全部原样输出!
...全文
196 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
yehanyy 2010-06-08
  • 打赏
  • 举报
回复
谢谢各位,问题自己解决了,代码如下:
<FCK:editor instanceName="content" basePath="/FCKeditor" width="800" height="500"><jsp:attribute name="value"><s:property value="contentInfo" escape="false" /></jsp:attribute></FCK:editor>
lzh_me 2010-06-07
  • 打赏
  • 举报
回复
你可以把查询出来的数据放在隐藏域里面,加载的时候放置数据。


<body onload="showFCK();">

//显示留言文本框
function showFCK(){

var oFCKeditor_des = new FCKeditor('_id');
oFCKeditor_des.BasePath = '${ct }/FCKeditor/';
oFCKeditor_des.ToolbarSet = 'yours';
oFCKeditor_des.Width = '80%';
oFCKeditor_des.Height = '200';
oFCKeditor_des.ReplaceTextarea();

}

yehanyy 2010-06-07
  • 打赏
  • 举报
回复
顶,大家帮忙啊。
yehanyy 2010-06-07
  • 打赏
  • 举报
回复
<FCK:editor instanceName="content" basePath="/FCKeditor" width="800" height="500">
我直接用这个标签输出的,你的意思是我得用JAVA代码输出是吗?
yehanyy 2010-06-07
  • 打赏
  • 举报
回复
function writeFCK(){
var str = document.getElementById("con").value;
FCKeditorAPI.GetInstance('content').EditorDocument.body.innerHTML=str;
}
window.attachEvent("onload", writeFCK);
不好用啊。
依依丫头 2010-06-07
  • 打赏
  • 举报
回复
//jsp使用FCKEditor
<%@ page language="java" import="com.fredck.FCKeditor.*" %>
<%
FCKeditor oFCKeditor ;
oFCKeditor = new FCKeditor( request, "content" ) ;
oFCKeditor.setBasePath( "/Village_Online/FCKeditor/" ) ;
oFCKeditor.setValue("");
oFCKeditor.setWidth("700");
oFCKeditor.setHeight("400");
out.println(oFCKeditor.create()) ;
%>

//js赋值
<script type="text/javascript">
document.getElementById("content").value="<%=content%>";
</script>
lq282514781 2010-06-07
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 lvbang_lzt 的回复:]

HTML code

//js
FCKeditorAPI.GetInstance('_id').EditorDocument.body.innerHTML=".......";
[/Quote]正解5
lzh_me 2010-06-07
  • 打赏
  • 举报
回复

//js
FCKeditorAPI.GetInstance('_id').EditorDocument.body.innerHTML=".......";

67,515

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧