<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jQuery Ajax 实例演示</title>
</head>
<script src="jquery-1.9.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
function GetRequest($type,$cid){
$.ajax({
type: "POST",
url: "post.php",
data:{
type: $type,
cid: $cid
},
success: function(msg){
$("#showResult").empty();//清除标签内原有内容
$("#showResult").append(msg);//附加内容带标签上去
}
});
};
</script>
<style type="text/css">
.ke{ width:600px;}
.ke ul li{ float:left; list-style-type:none; margin:5px;}
</style>
<body>
<div class="ke">
<ul>
<li><a href="#" onClick="GetRequest(275,284)"><span>+</span>神经内科</a></li><li><a href="#" onClick="GetRequest(275,285)"><span>+</span>消化内科</a></li>
</ul>
</div>
<br>
<table width="500" >
<tr>
<th>科室</th>
<th>专家</th>
<th>职称</th>
</tr>
</table>
<table width="500" id="showResult">
</table>
</body>
</html>
<?php
echo"<tr> <td align='center'>".$_POST['cid']."消化内科".$_POST['type']."</td><td align='center'><a href='/index.php?m=Index&a=read&sort=expert&id=6'>马雄飞</a></td><td>副主任医师,消化内科主任</td></tr>";
?>