富文本编辑器编辑后的文字如何保存到数据库?

富文本编辑器编辑后的文字如何保存到数据库?,第1张

<div id = "content1" hidden="hidden">

${content}

</div>

<div id = "content2">

</div>

<script type="text/javascript">

$(function() {

$("#content2").html($("#content1").text())

})

</script>

<INPUT type="hidden" name="content1" value="">

<IFRAME ID="eWebEditor1" SRC="edit/ewebeditor.asp?id=content1&style=system" FRAMEBORDER="0" SCROLLING="no" WIDTH="550" HEIGHT="350"></IFRAME>

input隐藏字段content1,与之对应:

edit/ewebeditor.asp?id=content&style=system中的

id要和input中的名字相同,也为content1

那么,提交后提取内容就用

Request("content1") 就可以了。

src 是你的“ewebeditor”文件夹实际的路径,style是样式,可以有多种选择

1:复制fckeditor的文件到项目目录,

2:加入下面的代码就有编辑器了。

3:获取编辑器数据,如下:

<script type="text/javascript">

window.onload=function(){

var oFCKeditor=new FCKeditor('ciintroduction')

oFCKeditor.BasePath="${pageContext.request.contextPath}/fckeditor/"

oFCKeditor.Width=400

oFCKeditor.Height=200

oFCKeditor.ToolbarSet="Basic"

oFCKeditor.ReplaceTextarea()

}


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/sjk/10064473.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-04
下一篇 2023-05-04

发表评论

登录后才能评论

评论列表(0条)

保存