function findObject(fName,initValue)...{ var XMLhttp = new ActiveXObject("Microsoft.XMLHTTP"); xmlhttp.open("POST","searchmx.jsp?findObject="+fName+"&initValue="+initValue,false);//注意修改jsp页面 xmlhttp.send(); document.getElementById(fName).innerHtml=bytes2BSTR(xmlhttp.responsebody); //bytes2BSTR函数在bytetostr.js中 }
Function bytes2BSTR(vIn) dim i strReturn = "" For i = 1 To LenB(vIn) ThisCharCode = AscB(MidB(vIn,i,1)) If ThisCharCode < &H80 Then strReturn = strReturn & Chr(ThisCharCode) Else NextCharCode = AscB(MidB(vIn,i+1,1)) strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode)) i = i + 1 End If Next bytes2BSTR = strReturn End Function