来个简单的,php代码不用改。
模板为ajax显示代码,在模板中加入一丢丢js代码
<script>
$("div.page a").click(function(e) {
e = e || window.event;
e.preventDefault();
var href =this.href;
window.history.pushState(null,'',href);//无刷新修改url,其他功能,前进后退自行脑补。
$.get(href , function(data){ $("ajaxcontent").html(data); });
});
</script> 最佳答案