<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:&#
ajax+JS 实现分页
最新推荐文章于 2022-06-19 15:26:52 发布
本文介绍了一种利用Ajax和JavaScript实现网页分页的方法,通过div展示数据,也可选择使用表格形式。详细实例说明了具体实现过程。
摘要由CSDN通过智能技术生成