首页  »  站长资讯  »  网站优化

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

2023/03/11 10:02     创新屋收录网     已浏览294次






想要实现在达到最大字数的时候,就禁止再继续输入了或者超出字数限制后,不能完整保存内容。



查阅很多资料,六久阁总结解决方法如下:



第一步:在/include/ueditor/ueditor.all.js中找到这两行注释掉



countDom.innerHTML = errMsg;



editor.fireEvent(“wordcountoverflow”)



第二步:在注释点的两行下面写上这三行就搞定了



var content = editor.getContentTxt();



editor.setContent(content.substring(0,max));



editor.focus(true);