array[i].trim();
is giving an error but only in ie8
it gives an error about 'unsupported method'.
Maybe .trim was removed in IE 9 ?
array[i].trim();
is giving an error but only in ie8
it gives an error about 'unsupported method'.
Maybe .trim was removed in IE 9 ?
String.trim()
was added in 1.8.1 and was not implemented in IE8 or lower.
At the start of the code you can use
if(!String.prototype.trim) {
String.prototype.trim = function () {
return this.replace(/^\s+|\s+$/g,'');
};
}
and .trim()
will be implemented for any strings.
See here.