苦配百度Ueditor

1.


Config类报错:

Error reading JObject from JsonReader. Current JsonReader item is not an object: Comment. Path '', line 1, position 28.

解决:

打开Json校验网:http://jsonlint.com/

把config.json内容全部粘过去,发现其头部 “/* 前后端通信相关的配置,注释只允许使用多行方式 */”这段注释导致了Json格式错误!赶紧删除,错误消失!


2. 文件结构:

3. ueditor.config.js:

   配置为:serverUrl: URL + "controller.ashx"


4.config.json:

 配置为: "imageUrlPrefix": "/scripts/ueditor/", /* 图片访问路径前缀 */


5.各种强大,各种华丽!



6. 后台取ueditor的值:

 遇到:从客户端中检测到有潜在危险的 Request.Form 值  :

 百度了一下,无非就是在web.config加两个节: (1)<pages validateRequest="false" controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"></pages>
                                                                             (2)<httpRuntime requestValidationMode="2.0" maxRequestLength="102400 " />

 OK,再测,依然是这个错误。

OK,我再给我的Action加上一个属性“[ValidateInput(false)]”,错误消失!


7.前台赋值问题:
         //ue.setContent( '@Model.Remark');
        // ue.setContent('<p>德国战车7:1乱伦巴西!</p>');
        //UE.getEditor('editor').execCommand('insertHtml', '<p>德国战车威力无比,希特勒笑了!</p>');
    这三种都失败!错误都进 ueditor.all.min.js里去了,说什么this.body = undefined?!开什么国际玩笑!

OK, 那我这样:
       <script id="editor" type="text/plain" style="width:800px;height:400px;">
            @Html.Raw(Model.Remark)

        </script>, 搞定!真是奇怪!


原帖地址:http://blog.youkuaiyun.com/unopenmycode/article/details/37598597#comments

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值