关于百度编辑器的一些心得

下载地址:百度编辑器

1.首先要把下载的包导入到你的项目里,然后在界面里添加引用:utf8-net/lang/zh-cn/zh-cn.js;utf8-net/ueditor.all.min.js;utf8-net/ueditor.config.js

2. js中加载:

var purchaseeditor_a;
        var purchaseeditorOption = {
            //这里可以选择自己需要的工具按钮名称,此处仅选择如下五个                  
            toolbars: [[
                            'source', '|', 'undo', 'redo', '|',
            'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor',   'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
            'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
            'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',
            'directionalityltr', 'directionalityrtl', 'indent', '|',
            'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|',
            'link', 'unlink', 'anchor', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', '|',
            'simpleupload', 'insertimage', 'emotion', 'scrawl', 'insertvideo', 'music', 'attachment', 'map', 'gmap', 'insertframe', 'insertcode', 'webapp', 'pagebreak', 'template', 'background', '|',
            'horizontal', 'date', 'time', 'spechars', 'snapscreen', 'wordimage', '|',
            'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', 'charts', '|',
            'print',  'searchreplace', 'help', 'drafts'
                                    ]],
                                    //'preview',                       
            //focus时自动清空初始化时的内容
           // autoClearinitialContent: true,
            //关闭elementPath
            elementPathEnabled: false,
            scaleEnabled: true,
            //不自动保存
            enableAutoSave:false
        };
        purchaseeditor_a = new baidu.editor.ui.Editor(purchaseeditorOption);
        purchaseeditor_a.render('contents');
        purchaseeditor_a.ready(function () {
        });

3.关于弹出界面被遮盖:

  $('.window-mask').css('z-index', '999');
                        $('.window-shadow').css('z-index', '1000');
                        $('.panel').css('z-index', '1001');

4.关于图片不显示:

找到config.json中配置

 "imageUrlPrefix": "/--路径--/", /* 图片访问路径前缀 */

5.关于HTML标签存数据库中MVC报危险的值存不进去:

  --web.config中加入

<system.web>
    <httpRuntime requestValidationMode="2.0"/>

</system.web>


<pages validateRequest="false">
    </pages>


--controller里添加

[ValidateInput(false)]

[HttpPost]


--界面添加

<%@ Page Language="C#"  validateRequest="false"%>


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值