trim function in javascript not working in ie8
sam
378
Points
48
Posts
|
Hi, I am using trim() as if ($("#Progressbar_Global").html().trim() == "") {
Not working in ie. |
Answers
Brian
2396
Points
13
Posts
|
Hi Sam, IE8 doesn't support the trim function. Add following code in top of the page: if (typeof String.prototype.trim !== 'function') {
String.prototype.trim = function () {
return this.replace(/^\s+|\s+$/g, '');
};
}
Posted On:
11-May-2015 00:44
it was helpful for me - nik 11-May-2018 20:46
|