你的内容的div将是:
<div id="content"></div>
<input type="button" id="my_subview">
<input type="button" id="subview">
<div id="wait"></div>
你必须使用jQuery + Ajax的,代码:
$("#my_subview").click(function(){
$.ajax({
type:"post",
url:"my_subview.php",
beforeSend: function(){
$('#wait').html('<img src="img/Loading.gif"/> Loading Data');
},
success:function(data){
$("#content").html(data); //Show in the div "content" a my_subview.php data
$('#wait').html('');
}
});
});
$("#subview").click(function(){
$.ajax({
type:"post",
url:"subview.php",
beforeSend: function(){
$('#wait').html('<img src="img/Loading.gif"/> Loading Data');
},
success:function(data){
$("#content").html(data); //Show in the div "content" a subview.php data
$('#wait').html('');
}
});
});
所以,当你点击在div的第一个按钮 “内容”,你会显示一个my_subview.php数据,当你点击第二个按钮时,你会在同一个div中显示一个subview.php数据
我们需要看到代码以及你到目前为止尝试过的东西(以及它为什么失败)给你一个回答河 – HenryTK