zoukankan      html  css  js  c++  java
  • kind富文本编辑器

    ## 1、页面
    <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
    <%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
    + request.getServerName() + ":" + request.getServerPort()
    + path + "/";
    %>

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <base href="<%=basePath%>">

    <title>My JSP 'kind.jsp' starting page</title>

    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">

    <script charset="utf-8" src="kindeditor/kindeditor-all.js"></script>
    <script charset="utf-8" src="kindeditor/lang/zh-CN.js"></script>
    <script>
    KindEditor.ready(function(K) {
    window.editor = K.create('#editor_id');
    });
    </script>
    </head>

    <body>
    内容:
    <textarea id="editor_id" cols="100" rows="8" style="700px;height:200px;visibility:hidden;"></textarea><br />
    </body>
    </html>

    2、附加kind

    <link rel="stylesheet" href="${path }/kindeditor/themes/default/default.css" />
    <link rel="stylesheet" href="${path }/kindeditor/plugins/code/prettify.css" />
    <script charset="utf-8" src="${path }/kindeditor/kindeditor-all.js"></script>
    <script charset="utf-8" src="${path }/kindeditor/lang/zh-CN.js"></script>
    <script charset="utf-8" src="${path }/kindeditor/plugins/code/prettify.js"></script>
    <script>
    KindEditor.ready(function(K) {
    var editor1 = K.create('textarea[name="content1"]', {
    cssPath : '${path }/kindeditor/plugins/code/prettify.css',
    uploadJson : '${path }/kindeditor/jsp/upload_json.jsp',
    fileManagerJson : '${path }/kindeditor/jsp/file_manager_json.jsp',
    allowFileManager : true,
    afterCreate : function() {
    var self = this;
    K.ctrl(document, 13, function() {
    self.sync();
    document.forms['example'].submit();
    });
    K.ctrl(self.edit.doc, 13, function() {
    self.sync();
    document.forms['example'].submit();
    });
    }
    });
    prettyPrint();
    });
    </script>



    内容:
    <textarea name="content1" cols="100" rows="8" style="700px;height:200px;visibility:hidden;"></textarea><br />

    ## 3、获取富文本的内容,修改前获取值

    //获取kindeditor的内容

    var content = $(document.getElementsByTagName("iframe")
    [0].contentWindow.document.body).html()

  • 相关阅读:
    [原][GIS]ARCGIS投影坐标系转换
    [转][osg]探索未知种族之osg类生物【目录】
    [转][osg]探究osg中的程序设计模式【目录】
    [原][资料整理][osg]osgDB文件读取插件,工作机制,支持格式,自定义插件
    [原][landcover]全球地表植被样例图片
    [转]arcgis for server 10.2 下载及安装
    [原]DOM、DEM、landcover,从tms服务发布格式转arcgis、google服务发布格式
    MySQL 数据库最优化设计原则
    MySQL常用存储引擎及如何选择
    Xtrabackup实现Mysql的InnoDB引擎热备份
  • 原文地址:https://www.cnblogs.com/xwd2366846227/p/11194457.html
Copyright © 2011-2022 走看看