存档
<script language="javascript"> //解决ajax提交表单时不能取得FCKeditor内容问题 function fck_form_updater() { this.UpdateEditorFormValue = function() { for ( i = 0; i < parent.frames.length; ++i ) if ( parent.frames[i].FCK ) parent.frames[i].FCK.UpdateLinkedField(); for(i = 0 ; i < frames.length ; ++i){ if(frames[i].FCK){ frames[i].FCK.UpdateLinkedField(); } } } } //在调用submit的ajax时如: function responseCallback(xmlHttp){ var fckupdater = new fck_form_updater(); fckupdater.UpdateEditorFormValue(); [...]
FCKeditor使用方法技术详解 作者:深蓝色 QQ:76863715 本文PHPChina论坛首发 本文特为《PHP5和MySQL5 Web开发技术详解》一书编写 1、概述 FCKeditor是目前最优秀的可见即可得网页编辑器之一,它采用JavaScript编写。 具备功能强大、配置容易、跨浏览器、支持多种编程语言、开源等特点。 它非常流行,互联网上很容易找到相关技术文档,国内许多WEB项目和大型网站 均采用了FCKeditor(如百度,阿里巴巴)。本文将通过与PHP相结合, 从基本安装到高级的配置循序渐进介绍给广大PHPer。 FCKeditor官方网站:http://www.fckeditor.net/ FCKeditor Wiki:http://wiki.fckeditor.net/ 2、下载FCKeditor 登录FCKeditor官方站(http://www.fckeditor.net),点击网站右上角“Download” 链接。 笔者编写本文时,FCKeditor当前最新的稳定版本是2.4.3,因此我们下载此版本的zip 压缩格式文档。如图1所示: 图1:下载FCKeditor 2.4.3(最新稳定版) 注意:当点击“FCKeditor_2.4.3.zip”链接后,将跳转到sourceforge.net网站上自动下载 。如果您当前使用Linux或Unix系统,可以点击“FCKeditor_2.4.3.tar.gz” 链接下载.tar.gz格式的压缩包。 3、安装FCKeditor 解压“FCKeditor_2.4.3.zip”文档到您的网站目录下, 我们先假定您存放FCKeditor和调用脚本存于同一个目录下。目录结构如下图所示: 图2:网站目录结构图 fckeditor目录包含FCKeditor2.4.3程序文件。check.php用于处理表单数据。 add_article.php和add_article_js.html分别是PHP调用FCKeditor和JavaScript调 用FCKeditor实例脚本文件。 3.1、用PHP调用FCKeditor 调用FCKeditor必须先载入FCKeditor类文件。具体代码如下。 <?phpinclude(“fckeditor/fckeditor.php”) ; // 用于载入FCKeditor类文件?> 接下来,我们需要创建FCKeditor实例、指定FCKeditor存放路径和创建 (显示)编辑器等。具体代码如下所示(代码一般放在表单内)。 <?php$oFCKeditor = new FCKeditor(‘FCKeditor1′) ; // 创建FCKeditor实例 $oFCKeditor->BasePath [...]



最近评论