str="sendRPCDone(frameElement,'adsf',new Array(,_ITEMA),new Array(,_ITEMB),new Array(''))"
do until rs.eof
str=Replace(str,",_ITEMA","'"+rs("spbh")+"',_ITEMA")
str=Replace(str,",_ITEMB","'"+rs("spmch")+"',_ITEMB")
rs.moveNext
loop
str=Replace(str,",_ITEMA","")
str=Replace(str,",_ITEMB","")
如上
另外,既然你用ajax,以这种直接返回script的方式不好,建议用返回xml或者json