下面是asp中的例子:
The following Microsoft&reg; JScript&reg; example posts a DOMDocument containing order information to an Active Server Pages (ASP) page on a server and returns the result as a new XML document.<script language="JScript">
  function PostOrder(xmldoc)
  {    
    var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP.4.0");
    xmlhttp.Open("POST", "http://myserver/orders/processorder.asp", false);
    xmlhttp.Send(xmldoc);
    return xmlhttp.responseXML;
  }
</script>
The ASP page on the server loads the posted XML document, processes the order, and builds a resulting XML document.<%@ language=javascript %>
<% 
    Response.Expires = -1000;
    // Load the posted XML document.
    var doc = Server.CreateObject("Msxml2.DOMDocument.4.0");
    doc.load(Request);
    var result = Server.CreateObject("Msxml2.DOMDocument.4.0");
    // Now process the order and build the result document.
    Response.ContentType = "text/xml";
    result.save(Response);
%>
在jsp页面里怎么办??????

解决方案 »

  1.   

    <script language="javascript">
    var oXMLDoc = new ActiveXObject('MSXML');
    oXMLDoc.url = "test.jsp?param="test";
    var oRoot=oXMLDoc.root;//数据就在这里拉(root是test.jsp的根)
    if(oRoot.children != null){
       for(var i=0;i<oRoot.children.length;++i)
       {
          oItem = oRoot.children.item(i);
          oItem1=oRoot.children.item(++i);
          sId=oItem1.text;
          sName = oItem.text;
          // 上面4句取值
          var oOption = document.createElement('OPTION');//
          oOption.text = sName;
          oOption.value = sId;
          form1.List.options.add(oOption);
          //显示在本页的下拉列表中
       }
    </script>test.jsp中文件如下
    <?xml version="1.0" encoding="gb2312"?>
    <root>
    <name>a</name>
    <value>1</value>
    <name>b</name>
    <value>2</value>
    <name>c</name>
    <value>3</value>
    </root>
    }
      

  2.   

    gamespeed() 你搞错了
    我的意思是在客户端的页面上向服务器上发送一个消息,然后服务器上的页面经过处理把消息再返回给客户端,客户端利用从服务器上得到的消息执行一些动作,可以实现不刷新页面就可改变页面中的内容。