dataLen:function(str){ var realLength = 0, len = str.length, charCode = -1; for(var i = 0; i < len; i++){ charCode = str.charCodeAt(i); if(charCode >= 0 && charCode <= 128) realLength += 1; else realLength += 2; } return realLength; }, js获取长度 相关文章: 2021-11-05 2021-11-05 2021-11-05 2021-09-07 2021-11-05 2021-11-05 2021-11-05 2022-01-07