想在main的DIV中实现局部刷新功能
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>yaham</title>
<link href="css/main.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
function go(n){
if(n==2){
$("#main").load("2.html");
}else if(n==3){
$("#main").load("3.html");
}
}
</script>
</head>
<body>
<div id="container">
<div id="header">此处显示 id "header" 的内容</div>
<div class="clearfloat"></div>
<div id="nav">
<center>
<ul>
<li><a href="Home.html">Home</a></li>
<li><a href="#" onclick="javascript:go(2);return false;">目录二</a></li>
<li><a href="#" onclick="javascript:go(3);return false;">目录三</a></li>
</ul>
</center>
</div>
<div class="clearfloat"></div>
<div id="main">
<table width="100%" height="100%" border="1">
<tr>
<td > </td>
<td > </td>
<td > </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</div>
<div class="clearfloat"></div>
<div id="footer">此处显示 id "footer" 的内容</div>
</div>
</body>
</html>