zoukankan      html  css  js  c++  java
  • kindeditor简单使用

    <%@ 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 'aa.jsp' starting page</title>
            <link rel="stylesheet" href="/flowctrl/js/kindeditor/default.css"
                type="text/css"></link>
            <script type="text/javascript"
                src="/flowctrl/js/kindeditor/kindeditor-min.js"></script>
            <script type="text/javascript" src="/flowctrl/js/kindeditor/zh_CN.js"></script>
            <script type="text/javascript"
                src="/flowctrl/easyui/jquery-1.8.0.min.js"></script>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            <script>
                var editor;
                KindEditor.ready(function(K) {
                    editor = K.create('textarea[name="content"]', {
                        resizeType : 1,
                        allowPreviewEmoticons : false,
                        allowImageUpload : false,
                        items : [
                            'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
                            'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
                            'insertunorderedlist', '|', 'emoticons', 'image', 'link']
                    });
                    K('input[name=getText]').click(function(e) {
                        var aa = encodeURI(editor.html(),"UTF-8"); 
                         $.ajax({
                            url:"/flowctrl/saveMessageAction.do",
                            type: "get",
                            data:{message:aa},
                            contentType: "application/x-www-form-urlencoded; charset=utf-8",
                            dataType: "text",
                            success: function(data){
                                  alert("发布成功!");
                                  $("#content").html("");
                             },
                            error: function(data){
                                 alert("发布失败!");
                             }
                         });
                    });
                });
        </script>
        </head>
    
        <body>
            <div align="center">
                <h2 style="color: ">
                    流控系统公告消息发布
                </h2>
                <form>
                    <textarea name="content" id="content" idd
                        style=" 700px; height: 200px; visibility: hidden;">注意:</textarea>
                    <input type="button" id="send" name="getText" value="发布" />
                </form>
            </div>
        </body>
    </html>
  • 相关阅读:
    bzoj2101:[USACO2010 DEC]TREASURE CHEST 藏宝箱
    P3976 [TJOI2015]旅游(未完成)
    洛谷 P 5 3 0 4 [GXOI/GZOI2019]旅行者
    NOIP原题 斗地主(20190804)
    P2860 [USACO06JAN]冗余路径Redundant Paths
    vue中的插槽(slot)
    vue动态绑定class
    发现一个ps抠毛发简单快捷高质量的方法
    propsData传递数据
    sort排序原理
  • 原文地址:https://www.cnblogs.com/holdon521/p/4332074.html
Copyright © 2011-2022 走看看