<html>
<head>
<script type="text/javascript" src="/jquery/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#txt").ajaxStart(function(){
$("#wait").css("display","block");
});
$("#txt").ajaxComplete(function(){
$("#wait").css("display","none");
});
$("button").click(function(){
$("#txt").load("/example/jquery/demo_ajax_load.asp");
});
});
</script>
</head>
<body>
<div id="txt"><h2>通过 AJAX 改变文本</h2></div>
<button>改变内容</button>
<div id="wait" style="display:none;width:69px;height:89px;border:1px solid black;position:absolute;top:50%;left:50%;padding:2px;">
<img src='/i/demo_wait.gif' width="64" height="64" />
<br />加载中 ...
</div>
</body>
</html>