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

 运行结果 
 北美留学生论坛