开发者

.trim() Not Working in ie [duplicate]

开发者 https://www.devze.com 2023-01-24 19:54 出处:网络
This question already has answers here: Closed 12 years ago. Pos开发者_开发问答sible Duplicate: .trim() in JavaScript not working in IE
This question already has answers here: Closed 12 years ago.

Pos开发者_开发问答sible Duplicate:

.trim() in JavaScript not working in IE

Is there any way to make .trim() work in Internet Explorer 6.


Does this thread help you to make it work ? : .trim() in JavaScript not working in IE

At the end, look the message from kaichanvong regarding IE6


make a custom function trim() for yourself

if (typeof String.prototype.trim !== 'function') {
  String.prototype.trim = function(s) {
     return s.replace(/^\s+|\s+$/g, "");
  }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消