html右下角的字数计算,百度UEditor修改右下角统计字数包含html样式

百度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了

原文:http://www.jb51.net/article/52645.htm

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值