function strLength(str) {
var a = 0;
for (var i = 0; i < str.length; i++) {
if (str.charCodeAt(i) > 255)
a += 2;//按照预期计数增加2
else
a++;
}
return a;
}
获取url中的参数
function GetQueryStringRegExp(name,url) {
var reg = new RegExp("(^|\?|&)" + name + "=([^&]*)(\s|&|$)", "i");
if (reg.test(url)) return decodeURIComponent(RegExp.$2.replace(/+/g, " ")); return "";
}