//拉取 function getNewsData(page,columnid){ var newsBlock = ''; $(".news_ajax_block").each(function(){ divid = $(this).attr('id'); var arr = divid.split('_'); typeid = parseInt(arr[1]); if(typeid==columnid){ $(this).show(); newsBlock = divid; }else{ $(this).hide(); } }); if(page==1){ return false; } $.ajax({ type: 'POST', url: basehost+"/plus/AjaxNewsList.php", data:{ 'columnid':columnid, 'pageNum':page, }, dataType:'json', beforeSend:function(){ $('#getmore_'+columnid).hide(); }, success:function(json){ if(json.msg == '110'){ $('#getmore_'+columnid).hide(); return false; } var li = ""; var list = json.list; if(list == undefined){ $('#getmore_'+columnid).hide(); return false; } $.each(list,function(index,array){ //遍历json数据列 li += '
  • '; li += '
    '; li += '

    '; li += ' '+array['fulltitle']+''; li += '

    '; li += '
    '; li += ' '; li += ' '+array['fulltitle']+''; li += ' '; li += '
    '; li += '

    '; li += ' '+array['pubdate1']+''; li += ' '+array['pubdate2']+''; li += '

    '; li += '

    '+array['description']+'

    '; li += '
    '; li += '
    '; li += '
    '; li += '
  • '; }); $("#"+newsBlock).children("ul").append(li); //列表显示 var totalPage = json.totalPage; //总页数 var nextPage = page+1; if(page < totalPage){ var newButton = '加载更多+'; $('#getmore_'+columnid).empty().append(newButton); $('#getmore_'+columnid).show(); }else{ $('#getmore_'+columnid).hide(); } }, complete:function(){ }, error:function(){ $('#getmore_'+columnid).hide(); } }); }