muban大师 发表于 2018-7-21 11:00:19

百度编辑器UEditor超出最大字数后不能完整保存解决方法

想要实现在达到最大字数的时候,就禁止再继续输入了或者超出字数限制后,不能完整保存内容。
       
        查阅很多资料,AB模版网总结解决方法如下:
       
       
       
        第一步:在/include/ueditor/ueditor.all.js中找到这两行注释掉
       
        countDom.innerHTML = errMsg;
       
        editor.fireEvent(“wordcountoverflow”)
       
       
       
        第二步:在注释点的两行下面写上这三行就搞定了
       
        var content = editor.getContentTxt();
       
        editor.setContent(content.substring(0]max));
       
        editor.focus(true);
页: [1]
查看完整版本: 百度编辑器UEditor超出最大字数后不能完整保存解决方法