案例:XML案例     状态:可编辑再运行    进入横版
AخA
<button onclick="loadXMLDoc('/example/xdom/note.xml')">Get XML</button>
 
1
<html>
2
<head>
3
<script type="text/javascript">
4
var xmlhttp;
5
function loadXMLDoc(url)
6
{
7
xmlhttp=null;
8
if (window.XMLHttpRequest)
9
  {// code for IE7, Firefox, Opera, etc.
10
  xmlhttp=new XMLHttpRequest();
11
  }
12
else if (window.ActiveXObject)
13
  {// code for IE6, IE5
14
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
15
  }
16
if (xmlhttp!=null)
17
  {
18
  xmlhttp.open("GET",url,false);
19
  xmlhttp.send(null);
20
  document.getElementById('A1').innerHTML=xmlhttp.status;
21
  document.getElementById('A2').innerHTML=xmlhttp.statusText;
22
  document.getElementById('A3').innerHTML=xmlhttp.responseText;
23
  }
24
else

 运行结果 
 北美留学生论坛