织梦系统 列表页实现【点击查看更多】有没有高手能从网页和JS代码,推写出 query.php中内容是什么吗? 20
$('.more').click(function(){vardata=$('.more').attr('data');if(data==1){$('.more').ht...
$('.more').click(function(){
var data = $('.more').attr('data');
if(data == 1){
$('.more').html('<img src="/include2015wap/images/juhua.gif" style="float:left;margin-right:5px;"/> 加载中...');
var page = $('.more').attr("page");
var page_n = parseInt(page) + 1;
$('.more').attr('page',page_n);
var catid = $('.more').attr("catid");
$.ajax({
type:"POST",
url:"/query.php",
data:{page_id:page,catid:catid,type:1},
dataType:"json",
success:function(msg){
if(msg){
var html = '';
$.each(msg,function(key,val){
html += '<div class="article"><div class="title"><a href="'+val.url+'">'+val.title+'</a></div><div class="content"><a href="'+val.url+'">'+val.description.substr(0,40)+'......</a><a href="'+val.url+'" class="cl_read">点击阅读</a></div></div>';
});
$('.article').last().after(html);
$('.more').html('<img src="/include2015wap/images/more.jpg" style="float:left;margin-right:5px;"/> 展开...');
}else{
$('.more').attr('data',2);
alert('没有内容了。');
$('.more').html('<img src="/include2015wap/images/more.jpg" style="float:left;margin-right:5px;"/> 没有了...');
}
}
})
}else{
alert('没有内容了。');
}
}) 展开
var data = $('.more').attr('data');
if(data == 1){
$('.more').html('<img src="/include2015wap/images/juhua.gif" style="float:left;margin-right:5px;"/> 加载中...');
var page = $('.more').attr("page");
var page_n = parseInt(page) + 1;
$('.more').attr('page',page_n);
var catid = $('.more').attr("catid");
$.ajax({
type:"POST",
url:"/query.php",
data:{page_id:page,catid:catid,type:1},
dataType:"json",
success:function(msg){
if(msg){
var html = '';
$.each(msg,function(key,val){
html += '<div class="article"><div class="title"><a href="'+val.url+'">'+val.title+'</a></div><div class="content"><a href="'+val.url+'">'+val.description.substr(0,40)+'......</a><a href="'+val.url+'" class="cl_read">点击阅读</a></div></div>';
});
$('.article').last().after(html);
$('.more').html('<img src="/include2015wap/images/more.jpg" style="float:left;margin-right:5px;"/> 展开...');
}else{
$('.more').attr('data',2);
alert('没有内容了。');
$('.more').html('<img src="/include2015wap/images/more.jpg" style="float:left;margin-right:5px;"/> 没有了...');
}
}
})
}else{
alert('没有内容了。');
}
}) 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询