开发者

.trim() Not Working in ie [duplicate]

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜