JavaScript计算字符串长度的方法,含中文字符的也可以统计var jmz = {};jmz.GetLength = function(str) { return str.replace(/[u0391-uFFE5]/g,"aa").length;};
alert(jmz.GetLength(nickname));