<script language="javascript"> xml = new ActiveXObject("Microsoft.XMLHTTP"); var post=" ";//構(gòu)造要攜帶的數(shù)據(jù) xml.open("POST","http://localhost:7001/TestWL/index.jsp",false);//使用POST方法打開一個(gè)到服務(wù)器的連接,以異步方式通信 xml.setrequestheader("content-length",post.length); xml.setrequestheader("content-type","application/x-www-form-urlencoded"); xml.send(post);//發(fā)送數(shù)據(jù) var res = xml.responseText;//接收服務(wù)器返回的數(shù)據(jù) document.write(res); </script>