javascriptにtrim関数を追加します.


                 trim  , js      ,     js         ,          trim(),ltrim() rtrim()   ,                 !  w3c  !
<script type='text/javascript'>
String.prototype.trim=function(){
        return this.replace(/(^\s*)|(\s*$)/g, "");
}
String.prototype.ltrim=function(){
        return this.replace(/(^\s*)/g,"");
}
String.prototype.rtrim=function(){
        return this.replace(/(\s*$)/g,"");
}
</script>