From now on, IE8 is only supported if polyfills for `Object.keys`, `Array.prototype.forEach`, and `Array.prototype.indexOf` are provided. The suggested polyfills from MDN are provided in ie8-polyfill.js, or you can use https://github.com/es-shims/es5-shim for a more complete set of polyfills.
10 lines
234 B
JavaScript
10 lines
234 B
JavaScript
if (!String.prototype.trim) {
|
|
(function() {
|
|
// Make sure we trim BOM and NBSP
|
|
var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
|
|
String.prototype.trim = function() {
|
|
return this.replace(rtrim, '');
|
|
};
|
|
})();
|
|
}
|