案例: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
  $("#b01").click(function(){
7
  htmlobj=$.ajax({url:"/example/jq/test1.txt",async:false});
8
  $("#myDiv").html(htmlobj.responseText);
9
  });
10
});
11
</script>
12
</head>
13
<body>
14
15
<div id="myDiv"><h2>通过 AJAX 改变文本</h2></div>
16
<button id="b01" type="button">改变内容</button>
17
18
</body>
19
</html>