解决IE中无法使用trim()的问题String.prototype.trim function () { return this .replace(/^\s\s*/,
解决IE中无法使用trim()的问题
String.prototype.trim = function () {
return this .replace(/^\s\s*/, '' ).replace(/\s\s*$/, '' );
}
用法:var str=' abc ';
str.trim();
解决IE中无法使用trim()的问题
String.prototype.trim = function () {
return this .replace(/^\s\s*/, '' ).replace(/\s\s*$/, '' );
}
用法:var str=' abc ';
str.trim();