trim可以除去字符串两侧的空白字符,但ie8并不支持
String.prototype.trim = function () { return this .replace(/^ss*/, '' ).replace(/ss*$/, '' ); }