摘要:
<script type="text/javascript"> window.onload = function(){function getByteLen(val) { var len = 0; for (var i = 0; i < val.length; i++) { var a = val.charAt(i); if (a.match(/[^\x00-\xff]/ig) != null){ len += 2; }else{ len += 1; } } return len; } alert(getByteLen('妈2ds')); 阅读全文
posted @ 2013-02-22 18:07 人生梦想起飞 阅读(2987) 评论(0) 推荐(0) 编辑