<script language="javascript"> xml = new ActiveXObject("Microsoft.XMLHTTP"); var post=" ";//构造要携带的数据 xml.open("POST","http://localhost:7001/TestWL/index.jsp",false);//使用POST方法打开一个到服务器的连接,以异步方式通信 xml.setrequestheader("content-length",post.length); xml.setrequestheader("content-type","application/x-www-form-urlencoded"); xml.send(post);//发送数据 var res = xml.responseText;//接收服务器返回的数据 document.write(res); </script>