案例:jQuery案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<html>
2
<head>
3
<script type="text/javascript" src="/js/jquery.js"></script>
4
<script type="text/javascript">
5
$(document).ready(function(){
6
  $("button").click(function(){
7
    $.getJSON("/example/jq/demo_ajax_json.js",function(result){
8
      $.each(result, function(i, field){
9
        $("p").append(field + " ");
10
      });
11
    });
12
  });
13
});
14
</script>
15
</head>
16
17
<body>
18
19
<button>获得 JSON 数据</button>
20
<p></p>
21
22
</body>
23
</html>