案例: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
  $("#txt").ajaxStart(function(){
7
    $("#wait").css("display","block");
8
  });
9
  $("#txt").ajaxComplete(function(){
10
    $("#wait").css("display","none");
11
  });
12
  $("button").click(function(){
13
    $("#txt").load("/example/jq/demo_ajax_load.html");
14
  });
15
});
16
</script>
17
</head>
18
19
<body>
20
21
<div id="txt"><h2>通过 AJAX 改变文本</h2></div>
22
<button>改变内容</button>
23
<div id="wait" style="display:none;width:69px;height:89px;border:1px solid black;position:absolute;top:50%;left:50%;padding:2px;">
24
<img src='/img/demo_wait.gif' width="64" height="64" />
25
<br />加载中 ...
26
</div>
27
28
</body>
29
</html>