资讯动态

ASP版最新FCKEditor编辑器的使用方法

日期:2015-01-04 作者:管理员 来源:本站

ASP版最新FCKEditor编辑器的使用方法

第一步,首先要下载FCKEditor编辑器源代码

去百度搜索,到FCKEditor编辑器官方网站下载,下载完FCKEditor后解压并上传到你网站的目录,最好就放在根目录下,文件夹名字就用FCKEditor;这里可以随便自己喜好。

第二步,在网站的后台页面里引用

首先引用FCKEditor:在你的页面里加入<!-- #include file="FCKeditor/fckeditor.asp" -->
然后在你页面中想要它显示的地方加入以下代码:

<%
Dim oFCKeditor
Set oFCKeditor = New FCKeditor
oFCKeditor.BasePath = "FCKeditor/"
oFCKeditor.ToolbarSet = "Default"
oFCKeditor.Width = "98%"
oFCKeditor.Height = "500px"
oFCKeditor.Value = ""
oFCKeditor.Create "logbody"
%>

这段的作用就是初始加载FCKeditor编辑器。这段网上都有注解,可以去搜索。

到此,你就已经添加成功,你的页面中就已经出现编辑器了。

如何把FCKeditor的内容保存到数据库,如何把数据库里的数据显示在FCKeditor中,我想这是多数初用者最想知道的。请看上面引用代码中的这一句:oFCKeditor.Create "logbody" 这里的logbody就代表你的FCKeditor,你也可以用其它的名字。

怎么使用呢,我是这样做的:用一个表单把它装起来,然后就和文本框一样使用了,如:

<form action="save.asp" method="post">
<%
Dim oFCKeditor
Set oFCKeditor = New FCKeditor
oFCKeditor.BasePath = "FCKeditor/"
oFCKeditor.ToolbarSet = "Default"
oFCKeditor.Width = "98%"
oFCKeditor.Height = "500px"
oFCKeditor.Value = ""
oFCKeditor.Create "logbody"
%>
</form>

然后在save.asp里读取:text=request("logbody"),这里的text就是你要的内容,把他把存到数据库中就OK。把数据库里的内容显示在FCKeditor中就在引用代码中给这句赋值oFCKeditor.Value = ""

资料整理:珠海网站建设网 http://xyvt.cn 转载时请注意标明来源。

二维码
扫二维码手机查看该文章
当前网址:http://xyvt.cn/webseo/98.html

相关资讯


Copyright © 2007-2024 珠海市网讯互联信息科技有限公司 xyvt.cn 版权所有
粤公网安备44040202000391号 粤ICP备19117377号 网站地图 站点地图
在线客服
链接链接链接链接链接链接