代码示例:(标识:jquery_ajax_load_func)
<html>
<head>
<script type="text/javascript" src="/jquery/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
  $("button").click(function(){
    $("div").load("/static/demo/xml/cd_catalog.xml",function(response,status){
      if (status=="success")
      {
      $("div").html("<ol></ol>");
      $(response).find("artist").each(function(){
        var item_text = $(this).text();
        $('<li></li>').html(item_text).appendTo('ol');
        });
      alert("There are "+$(response).find("cd").size()+" CDs")
      }
    });
  });
});
</script>
</head>
<body>
<p>Artists</p>
<div></div>
<button>获得 CD 信息</button>
<p>本例中使用的 XML 文件是 <a href="/static/demo/xml/cd_catalog.xml" target="_blank">cd_catalog</a></p>
</body>
</html>
运行结果: