//截取字符串多余显示引号 var cutStrForNum = function (str, num) { var len = 0; for (var i = 0; i < str.length; i++) { if (str[i].match(/[^\x00-\xff]/ig) != null) //全角 len += 2; else len += 1; } if (len >= num) { newStr = str.substring(0, num) + "..."…
function noSpace(x){ if(x.match(/\s*/g)){ return x.replace(/\s*/g,""); }else{ return x; } } --- function noSpace(x){ return x.replace(/\s/g, ''); } --- function noSpace(x){ var result = "" for(var index = 0; index < x.length; index+…