//添加字符串的Trim()方法
String.prototype.Trim= function() { 
return  this.replace(/(^\s+)|(\s+$)/g, "");
}

解决方案 »

  1.   

    <SCRIPT LANGUAGE="JavaScript">
    <!--
        function testcontent()
        {
            alert("**"+self.opener.document.all.discussionContent.value.Trim()+"**");    }
        //字符串操作
        function String.prototype.Trim()
        {
            return this.replace(/^\s*/g,"").replace(/\s*$/g,"");
        }
    //-->
    </SCRIPT>
      

  2.   

    我晕倒,Trim()是我已经定义的函数,可以正常使用。请看看我的问题?
      

  3.   

    <body onclick="window.open('c.asp')">
    不应该是
    <body onclick="window.open('vte/c.asp')">么,你没打开吧
      

  4.   

    说不定是你自己定义的Trim()函数的问题啊