JavaScript兼容性问题及解决

1.javaScript的trim();函数在ie中的不支持,重写trim()方法;

//跨浏览器的trim脚本
String.prototype.trim = function(){
return this.replace(/(^\[*)|(\]*$)/g,"");
}

 

posted @ 2013-05-24 10:22  飞翔的花狸猫  阅读(154)  评论(0编辑  收藏  举报