• 百度富文本编辑器


    <!-- https://mvnrepository.com/artifact/com.baidu.ueditor/ueditor -->
            <dependency>
                <groupId>com.baidu</groupId>
                <artifactId>ueditor</artifactId>
                <version>1.1.2</version>
            </dependency>
    <script id="container" type="text/plain" style="100%;height:600px;"></script>
    <script type="text/javascript">
    //初始化
    var ue = UE.getEditor('container', {
        autoHeightEnabled: false,
        //图表多行显示 对应参考http://fex.baidu.com/ueditor/#start-toolbar
    //     toolbars: [
    //         [
    //             'anchor', 'undo',  'redo', 'bold', 'indent','snapscreen','italic', 'underline', 'strikethrough',  'subscript', 'fontborder','superscript','formatmatch', 'source', 'blockquote', 'pasteplain', 'selectall','print', 'mergedown',  'deleterow', 'deletecol',
    //         ],
    //         [
    //             'splittorows','splittocols','splittocells','deletecaption', 'inserttitle', 'mergecells','deletetable', 'cleardoc','insertparagraphbeforetable', 'insertcode', 'fontfamily',  'fontsize',  'paragraph','simpleupload','insertimage','edittable',  'edittd','link','emotion','spechars','searchreplace','map', 'gmap', 'insertvideo',  'help',  'justifyleft','justifyright', 'justifycenter', 'justifyjustify',  'forecolor','backcolor', 
    //         ],
    //         [
    //             'insertorderedlist', 'insertunorderedlist','fullscreen','directionalityltr','directionalityrtl','rowspacingtop', 'rowspacingbottom', 'pagebreak', 'insertframe', 'imagenone', 'imageleft',  'imageright','attachment', 'imagecenter','wordimage', 'lineheight','edittip ',  'customstyle','autotypeset','webapp','touppercase', 'tolowercase','background','template','scrawl','music', 'inserttable','drafts',  'charts', // 图表
    //         ]
    //     ]
    });
    
    // var ue = UE.getContent();
    // //对编辑器的操作最好在编辑器ready之后再做
    // ue.ready(function() {
    //     //设置编辑器的内容
    //     ue.setContent('hello');
    //     //获取html内容,返回: <p>hello</p>
    //     var html = ue.getContent();
    //     console.log(html)
    //     //获取纯文本内容,返回: hello
    //     var txt = ue.getContentTxt();
    // });
    </script>
    后台获取内容直接用editorValue接受
    public String save(String editorValue) {}

    注意:出版本为jsp版本

  • 相关阅读:
    Business English E-mail
    向数据库更新数据
    遍历DataTable
    Convert SqlDataReader to DataTable
    (十七)map、flatMap和reduce方法的补充
    (4)六顶思考帽
    (3)学习方法思维导图
    (十六)call、apply、bind的实现以及区别
    (十五)关于继承
    (十四)防抖和节流
  • 原文地址:https://www.cnblogs.com/ch94/p/14718539.html
Copyright © 2020-2023  润新知