ajax+JS 实现分页

<script type="text/javascript">
		$(function(){
			$("#titleName").val('${titleName}');
			//加载日期框
			$('#startDate').datebox({    
			    required:false   
			}); 
			$("#endDate").datebox({
				required:false
			});
			//加载数据
			var articleList = ${articleList};
			for(var i=0;i<articleList.length;i++){
				var date = new Date(articleList[i].acticleDate);
				var year = date.getFullYear();
				var month = (date.getMonth()+1)>=10?(date.getMonth()+1):"0"+date.getMonth();
				var day = date.getDate()>=10?date.getDate():"0"+date.getDate();
				var Hours = date.getHours()>=10?date.getHours():"0"+date.getHours();
				var minutes = date.getMinutes()>=10?date.getMinutes():"0"+date.getMinutes();
				var seconds = date.getSeconds()>=10?date.getSeconds():"0"+date.getSeconds();
				var strDate = year+"-"+month+"-"+day+" "+Hours+":"+minutes+":"+seconds;
		  	  	$("#titleAbstract"+i).html("<div class='titleDateByDingjd'><div class='titleByDingjd'><a style='font-size:18px;font-weight:bold;font-family:STSong;letter-spacing:2px;' href='"+articleList[i].fullHtml+"'>"+articleList[i].title+"</a></div><div class='dateByDingjd'>"+strDate+"</div></div>"+
      			"<div class='abstractByDingjd'>"+articleList[i].articleAbstract+"</div>");
		  		$("#titleAbstract"+i).show();
		  		$("#chrByDingjd"+i).show();
		  	}
		  	var count = ${count};
		  	$("#installPage").html("<div class='tiao'>共"+count+"条  第1/"+Math.ceil(count/10)+"页  <a href='javascript:;' οnclick='turnPage(0)'>首页</a>  <a href='javascript:;' οnclick='turnPage(1)'>上一页</a>  <a href='javascript:;' οnclick='turnPage(2)'>下一页</a>  <a href='javascript:;' οnclick='turnPage(3)'>尾页</a>"+
		  						   "<input style='width:50px' id='skipPage' name='skipPage' value='1' type='text' /><button οnclick=''>转到</button></div>");
		});
		
        //点击查询触发的函数
        function searchByCondition(){
        	 var titleName = $("#titleName").val();
        	 var articleAbstract = $("#articleAbstract").val();
        	 var articleSource = $("#articleSource").val();
        	 var columnId = $("#columnId").val();
        	 var startDate = $("#startDate").datebox('getValue');
        	 var endDate = $("#endDate").datebox('getValue');
        	 $.ajax({
        	 	url:'${ctx}/messageSearch.json',
        	 	data:{titleName:titleName,articleAbstract:articleAbstract,articleSource:articleSource,columnId:columnId,startDate:startDate,endDate:endDate},
        	 	type:&#
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值