案例:XML 实例     状态:不可编辑再运行    进入竖版
 运行结果 
x
 
1
<html>
2
<head>
3
<script type="text/vbscript">
4
dim xmlhttp
5
6
function loadXMLDoc(url)
7
set xmlhttp=createObject("Microsoft.XMLHTTP")
8
xmlhttp.onreadystatechange=getRef("state_Change")
9
call xmlhttp.open("GET",url,true)
10
call xmlhttp.send()
11
end function
12
13
function state_Change()
14
if xmlhttp.readyState=4 then
15
  if xmlhttp.status=200 then
16
    alert("XML data OK")
17
    document.getElementById("A1").innerText=xmlhttp.status
18
    document.getElementById("A2").innerText=xmlhttp.statusText
19
    document.getElementById("A3").innerText=xmlhttp.responseText
20
  else
21
    alert("Problem retrieving XML data:" & xmlhttp.statusText)
22
  end if
23
end if
24
end function
25
26
</script>
27
</head>
28
29
<body onload="loadXMLDoc('/example/xmle/note.xml')">
30
<h2>Using the HttpRequest Object</h2>
31
32
<p><b>status:</b>
33
<span id="A1"></span>
34
</p>
35
36
<p><b>status text:</b>
37
<span id="A2"></span>
38
</p>
39
40
<p><b>response:</b>
41
<br /><span id="A3"></span>
42
</p>
43
44
</body>
45
</html>
46