trim()函数IE7/8不兼容
js中重写trim()函数
<script type=
"text/javascript"
>
String.prototype.trim =
function
()
{
return
this
.replace(/(^\s*)|(\s*$)/g,
""
);
}
</script>
<script type=
"text/javascript"
>
String.prototype.trim =
function
()
{
return
this
.replace(/(^\s*)|(\s*$)/g,
""
);
}
</script>