<button type="button" onClick="goto()">下一页</button>
<script>
var page = 1;
function goto(){
var o = {
url:"index_"+page+".html",
success:function(html){
$("#div").append(html);
page++;
},
error:function(e){
}
};
$.ajax(o);
}
</script>
——电脑端用翻页
<script>
//加载更多
function getMore(chnlPath,id){
var page=$(id).next("a").attr("page");
var obj = {
url:chnlPath+"index_"+page+".html",
success:function(html){
$(id).append(html);
page++;
$(id).next("a").attr("page",page);
},
error:function(e){
}
};
$.ajax(obj);
}
</script>
——手机端用ajax实现加载更多,点击按钮加载下一页文档列表