日期:2014-05-16  浏览次数:20426 次

为什么下一页 只能点一次 再点没有反应了~~
为什么下一页 只能点一次 再点没有反应了~~
var Yejiao={
first:"<span id='ch_ajax_page_first'>首页</span>",
last:"<span id='ch_ajax_page_last'>尾页</span>",
prepage:"<span id='ch_ajax_page_prepage'>上一页</span>",
nextpage:"<span id='ch_ajax_page_next'>下一页</span>",
getyejiao:function(pagenow,pagecounts){
var yejiaos="";
if(pagecounts>1){
if(pagenow == 1){yejiaos=this.prepage+this.nextpage+this.last;}
if(pagenow == pagecounts){yejiaos=this.first+this.prepage+this.nextpage;}
if(pagenow!=1 && pagenow!=pagecounts){yejiaos=this.first+this.prepage+this.nextpage+this.last;}
}
return yejiaos;
},
};
var pagenow=1;
var pagecounts=30;
$(function(){
$("ul li:last").append(Yejiao.getyejiao(pagenow,pagecounts));
$("#ch_ajax_page_next").click(function(){
if(pagenow==pagecounts){pagenow=pagecounts;}else{pagenow=pagenow+1;}
var sql1="select * from dt limit "+(pagenow-1)*8+",8";
alert(sql1);
$.post("ajax1.php",
{sql1:sql1},
function(data){
$("#dd").html(data);
$("ul li:last").html(Yejiao.getyejiao(pagenow,pagecounts));  
});

}); 
});


------解决方案--------------------
楼主、你自己解决了么?
------解决方案--------------------
动态生成的dom,需要用live来绑定事件