overwrite javascript trim() method:
/*
*javascript trim() repair bug.
*/
String.prototype.trim = function() {
return this.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
}
IE8 兼容JS trim() 解决方案
最新推荐文章于 2024-06-11 07:30:00 发布
overwrite javascript trim() method:
/*
*javascript trim() repair bug.
*/
String.prototype.trim = function() {
return this.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
}