日期:2009-03-30  浏览次数:21036 次

<html>
<head>
</head>
<body>

<p> </p>
<script language=vbscript>
function VBTrimStr(temStr)
VBTrimStr=trim(temStr)
end function
</script>

<script language=javascript>
function TrimStr(temStr){
    return VBTrimStr(temStr)
}    
</script>
<form name=fmTest>
<input type=text name=txtTest>
<input type=button name=btnOk value=ok>
</form>
<script language=javascript for=btnOk event=onclick>
    var getStr=document.fmTest.txtTest.value
    alert("*" + getStr + "*")
    getStr=TrimStr(getStr)
    alert("*" + getStr + "*")
</script>
</body>
</html>