UEditor设置最大字数限制
ueditor字数超出只读,禁止输入
1.搜索ueditor.all.js中的maximumWords,找到以下段落:
countDom.innerHTML = errMsg;
editor.fireEvent("wordcountoverflow");2.下这段代码的下方,加上:
var content = editor.getContentTxt();
editor.setContent(content.substring(0,max));
editor.focus(true);如果是min版的js,在对应位置加上:
,content = a.getContentTxt(),a.setContent(content.substring(0,d)),a.focus(true)这种方法有个问题,就是因为是js的substring控制的,
在输入超过最大字数时,会先显示出内容,然后再回退,