百度UEditor修改右下角統計字數默認只統計前臺所見的文字個數,為了便于展示實際保存的時候是保存的包含html標簽的,所以右下角的統計字數功能需要修改
/*** 計算編輯器當前內容的長度* @name getContentLength* @grammar editor.getContentLength(ingoneHtml,tagNames) =>* @example* editor.getLang(true)* * 2013年7月1日16:53:15 注釋掉的內容為 去除html標記后的內容數,實際入庫是算上html標簽和文字的 所以統計字數以getContents為準*/getContentLength: function (ingoneHtml, tagNames) {var count = this.getContent(false,false,true).length;/*if (ingoneHtml) {tagNames = (tagNames || []).concat([ 'hr', 'img', 'iframe']);count = this.getContentTxt().replace(/[/t/r/n]+/g, '').length;for (var i = 0, ci; ci = tagNames[i++];) {count += this.document.getElementsByTagName(ci).length;}}*/return count;},
找到ueditor.all.js這個文件 找到4944行到4951行 注釋掉 就ok了