ie8 不支持 trim方法

2023-03-12,,

那就自己写一个trim() 
String.prototype.trim = function() {
                return this.replace(/(^\s*)|(\s*$)/g, ""); //正则匹配空格  
   }

ie8 不支持 trim方法的相关教程结束。

《ie8 不支持 trim方法.doc》

下载本文的Word格式文档,以方便收藏与打印。