`

Fckeditor的使用(二):Fckeditor安装与例子

阅读更多

1.安装

        把FCKeditor_2.6.3.zip解压后的内容拷到WebRoot下。

2.使用

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<html>
  <head>
    <title>My JSP 'index.jsp' starting page</title>
  </head>
      <script type="text/javascript" src="fckeditor/fckeditor.js"></script>
      <script type="text/javascript">
        var oFCKeditor = new FCKeditor('FCKeditor1');
        oFCKeditor.BasePath = "<%=request.getContextPath()%>/fckeditor/";
        oFCKeditor.Create();
    </script>
    <script type="text/javascript">
        window.onload = function() {
            var oFCKeditor = new FCKeditor( 'MyTextarea' ) ;
            oFCKeditor.BasePath = "<%=request.getContextPath()%>/fckeditor/" ;
            oFCKeditor.ReplaceTextarea() ;
        }
    </script>
   
     
  <body>
    This is my JSP page. <br>
    <textarea rows="4" cols="60" name="MyTextarea" style="display:none">default</textarea>
  </body>
</html>

 

修改

三种方法:

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<html>
  <head>
    <title>My JSP 'index.jsp' starting page</title>
  </head>
      <script type="text/javascript" src="fckeditor/fckeditor.js"></script>
     
      <script type="text/javascript">
          //第一种方法
        var oFCKeditor = new FCKeditor('FCKeditor1');
        oFCKeditor.BasePath = "<%=request.getContextPath()%>/fckeditor/";
        oFCKeditor.Width = "70%";
        oFCKeditor.Height = "150";
        oFCKeditor.Value = "default"
        oFCKeditor.Create();
    </script>
   
    <script type="text/javascript">
       
        window.onload = function() {
            //第二种方法
            var oFCKeditor = new FCKeditor( 'MyTextarea' ) ;
            oFCKeditor.BasePath = "<%=request.getContextPath()%>/fckeditor/" ;
            oFCKeditor.ReplaceTextarea() ;
            //第三种方法
            var div = document.getElementById("myFCKeditor");
            var fck = new FCKeditor("myFCKeditor");
            fck.BasePath = "<%=request.getContextPath()%>/fckeditor/" ;
            div.innerHTML = fck.CreateHtml();
        }
    </script>
   
  <body>
      <br/>Method 2<br/>
    <textarea rows="4" cols="60" name="MyTextarea" style="display:none">default</textarea>
     <br/>Method 3  <br>
     <div id="myFCKeditor">
     </div>
  </body>
</html>

分享到:
评论

相关推荐

    asp.net FCKeditor 配置例子

    3. **Default.aspx.cs**: 这是与Default.aspx对应的后台代码文件,通常使用C#编写。在这个文件中,你可以处理FCKeditor提交的内容,例如保存到数据库,或者处理上传的文件。 4. **fckeditor**: 这个文件夹可能包含...

    fckeditor小例子

    1. **安装与集成** FCKeditor通常以压缩包形式提供,包含了所有必要的文件和资源。下载后,解压到服务器的适当位置,并在网页中通过JavaScript API进行引用。例如,可以通过创建`&lt;script&gt;`标签引入`fckeditor.js`...

    FCKeditor使用方法详解

    以下是一个简单的PHP调用FCKeditor的例子: ```php include("fckeditor/fckeditor.php"); // 引入FCKeditor类文件 ?&gt; ; charset=utf-8"&gt; 调用FCKeditor示例 $oFCKeditor = new FCKeditor('FCKeditor1'); // ...

    在EXT中使用FCKEditor编辑器例子

    这篇博客文章“在EXT中使用FCKEditor编辑器例子”可能探讨了如何将FCKEditor集成到EXT应用中,为用户提供一个方便的文本编辑界面。 在EXT中集成FCKEditor,首先你需要理解EXT的基本概念,如组件(Component)、布局...

    用MyEclipse集成FCKeditor的几个小例子

    三、下载与引入FCKeditor 1. 访问FCKeditor官方网站下载最新版本的FCKeditor压缩包。 2. 解压下载的文件,将解压后的`fckeditor`目录复制到Web项目的`WebContent`或`Web-INF`下的`js`目录中,这样便于在项目中引用。...

    fckeditor2.6.3 完整版

    1,假如编辑器已经安装在你的站点的/FCKEDITOR/文件夹下.那么,第一步我们需要做的就是在页面的HEAD段中放入SCRIPT标记以引入JAVASCRIPT整合模块.例如: &lt;script type="text/javascript" src="/fckeditor/fckeditor.js...

    FCKeditor应用完整例子

    二、J2EE与JSP J2EE(Java 2 Platform, Enterprise Edition)是Java平台的企业版,用于构建和部署企业级应用程序。JSP(JavaServer Pages)是J2EE的一部分,是一种动态网页技术,允许开发人员在HTML代码中嵌入Java...

    FCKEditor 3.5.3使用配置教程与项目小列子(包会)

    **二、安装与配置** 1. **下载FCKeditor**:首先,你需要从官方或第三方源获取FCKeditor 3.5.3的压缩包,解压到你的项目资源目录下。 2. **引入FCKeditor**:在HTML页面中,通过`&lt;script&gt;`标签引入FCKeditor的...

    Fckeditor的使用和例子

    **安装与集成** 1. **下载与解压**:首先,你需要从Fckeditor的官方网站或者可靠的开源平台下载Fckeditor的压缩包,然后将其解压到服务器上的适当目录。 2. **配置路径**:Fckeditor需要知道其资源文件(如图片、...

    java与fckeditor例子

    在这个例子中,我们将探讨如何将两者结合,以便在Java驱动的Web应用中集成FCKeditor,提供用户友好的文本编辑体验。 首先,我们需要理解FCKeditor的基本使用。FCKeditor通过JavaScript库在前端运行,允许用户在...

    JSP例子:Fckeditor整合web EQ 公式编辑器

    **JSP例子:Fckeditor整合web EQ 公式编辑器** 在Web开发中,富文本编辑器(Rich Text Editor)是常用于创建和编辑带有格式的HTML内容的工具。FCKeditor是一个流行的开源富文本编辑器,而web EQ则是一个用于在网页...

    Fckeditor的使用例子

    4. **ReadMe.txt** - 这个文件通常包含了关于如何安装、配置和使用Fckeditor的说明,可能还包括了版本更新和已知问题的信息。 5. **Files** - 这可能是一个文件夹,用于存储用户通过Fckeditor上传的文件,如图片或...

    比较常用的组建fckeditor的实例

    1. **下载与安装**:首先从FCKeditor官网下载最新版本,解压后将文件夹放入服务器目录。 2. **引入FCKeditor**:在HTML页面中添加FCKeditor的JavaScript文件引用,并设置编辑器的ID。 3. **初始化编辑器**:在...

    ASP.NET中FCKEditor配置教程

    以下是一个简单的例子: ```html &lt;!DOCTYPE html&gt; ... &lt;FCKeditorV2:FCKeditor ID="FCKeditor1" runat="server" BasePath="/fckeditor/" Width="100%" Height="400"&gt;&lt;/FCKeditorV2:FCKeditor&gt; ... ``` 这...

    jsp中使用FCKEditor

    以下是一个简单的例子: ```javascript var oFCKeditor = new FCKeditor('editorContent') ; oFCKeditor.BasePath = '/js/fckeditor/' ; // 设置FCKeditor的基础路径 oFCKeditor.Width = '100%' ; // 设置宽度 ...

    简易博客 asp.net源码 fckeditor例子

    通过分析和学习这个【简易博客 ASP.NET 源码 FCKeditor 示例】,开发者不仅可以了解ASP.NET的基础知识,还能深入理解Web应用程序的开发流程,同时掌握FCKeditor的使用,提升前端用户体验。这个项目对初学者来说是一...

    如何配置fckeditor

    #### 第二步:安装FCKEditor 1. **放置文件**:将解压后的文件夹放置到你的网站目录下。比如文中提到的例子是放置到了`F:\web\fckeditor`路径下。 2. **安装FCKeditor.Net**:文中提到了还需要安装`FCKeditor.Net...

    fckeditor例子

    3. **引入JavaScript**:在需要使用FCKeditor的页面中,通过`&lt;script&gt;`标签引入FCKeditor的JavaScript库。 4. **初始化编辑器**:在页面加载完成后,使用JavaScript代码初始化FCKeditor,指定编辑器的ID和容器元素...

    FCKeditor

    ### 二、FCKeditor配置说明 FCKeditor的配置主要在`fckconfig.js`文件中进行,常见的配置选项包括: 1. **工具栏**:你可以定制编辑器的工具栏,添加或移除按钮,如`Config.ToolbarSets`配置。 2. **语言**:设置...

Global site tag (gtag.js) - Google Analytics