案例:XML案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<html>
2
<body>
3
<script type="text/javascript">
4
xmlHttp=null;
5
if (window.XMLHttpRequest)
6
  {// code for IE7, Firefox, Opera, etc.
7
  xmlHttp=new XMLHttpRequest();
8
  }
9
else if (window.ActiveXObject)
10
  {// code for IE6, IE5
11
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
12
  }
13
if (xmlHttp!=null)
14
  {
15
  xmlHttp.open("GET", "/example/xdom/note.xml", false);
16
  xmlHttp.send(null);
17
  xmlDoc=xmlHttp.responseText;
18
19
  xmlHttp.open("POST", "/example/xdom/demo_dom_http.asp", false);
20
  xmlHttp.send(xmlDoc);
21
  document.write(xmlHttp.responseText);
22
  }
23
else
24
  {
25
  alert("Your browser does not support XMLHTTP.");
26
  }
27
</script>
28
</body>
29
</html>
30