ie8 不支持 trim方法

那就自己写一个trim() 
String.prototype.trim = function() {
                return this.replace(/(^\s*)|(\s*$)/g, ""); //正则匹配空格  
   }

猜你喜欢

转载自www.cnblogs.com/j190512/p/12574401.html