adding prototype trim as fallback for IE8

This commit is contained in:
Thomas Mueller 2013-02-14 12:59:26 +01:00
parent 8065c73339
commit e643742eb3
1 changed files with 7 additions and 0 deletions

View File

@ -23,3 +23,10 @@ if (!Function.prototype.bind) {
return fBound;
};
}
//https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/Trim
if(!String.prototype.trim) {
String.prototype.trim = function () {
return this.replace(/^\s+|\s+$/g,'');
};
}