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

    因公司需要,让我开发一个论坛。。以前没经验。

    论坛首先的有有个编译器

    我在网上找到了

    KindEditor:

    KindEditor是一套开源的HTML可视化编辑器,主要用于让用户在网站上获得所见即所得编辑效果,兼容IE、Firefox、Chrome、Safari、Opera等主流浏览器。 KindEditor使用JavaScript编写,可以无缝的与Java、.NET、PHP、ASP等程序接合。这个是官网上的介绍。

    主页:http://www.kindsoft.net/index.php

    下载:http://www.kindsoft.net/down.php

    示例:http://www.kindsoft.net/demo.php

    首先我们导入完整的包

    html代码:

    <!doctype html>
    <html>
    <head>
        <meta charset="utf-8" />
        <title>Simple Examples</title>
        <style>
            form {
                margin: 0;
            }
            textarea {
                display: block;
            }
        </style>
        <link rel="stylesheet" href="js/themes/default/default.css" />
        <script charset="utf-8" src="js/kindeditor-min.js"></script>
        <script charset="utf-8" src="js/lang/zh_CN.js"></script>
        <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']
                });
            });
        </script>
    </head>
    <body>
    <h3>发帖</h3>
    <form action="www.baidu.com" method="post" style=" 750px" name="formData">
        <fieldset>
            <legend>快速发帖</legend>
            <input type="text" style="400px "/>还可以输入xx字
            <br>
            <br>
            <textarea name="content" style="700px;height:200px;visibility:hidden;" id="text">您需要登录后才可以发帖 登录 | 立即注册</textarea>
            <br>
            <button style="submit" >发表帖子</button>
        </fieldset>
    </form>
    </body>
    </html>
    

      效果展示:

  • 相关阅读:
    Java转Exe
    匹配数字和字母的正则表达式
    POI
    Maven– HelloWorld实例
    eclipse+maven+tomcat构建web工程
    Maven
    SSH
    Struct2小结:
    Eclipse中没有javax.servlet和javax.servlet.http包的处理办法
    openSession()与getCurrentSession()的区别
  • 原文地址:https://www.cnblogs.com/sanhuan/p/4569731.html
Copyright © 2011-2022 走看看