html ajax分页,ajax动态加载页面(分页)

ajax请求控制层返回的页面append到相应的标签中。

@RequestMapping("/ajaxFindProjectByCodition")

public String ajaxFindProjectByCodition(@RequestParam(value="projectIndustry",defaultValue="-1") Integer projectIndustry,

@RequestParam(value="projectStatus",defaultValue="-1") Integer projectStatus,@RequestParam(value="orderType",defaultValue="-1") Integer orderType,

@RequestParam(value="currentPage",defaultValue= "1") Integer currentPage,Model model,HttpServletRequest request) throws UnsupportedEncodingException{

//关键字

String key=request.getParameter("key");

if(!StringUtil.isEmpty(key)){

key=URLDecoder.decode(key,"utf-8");

}

List raiseProjectList = projectService.findProjectListByCondition(RAISETYPE_AWARD,projectIndustry,projectStatus,orderType,currentPage,PAGE_SIZE,key);

model.addAttribute("raiseProjectList", raiseProjectList);

return  "/client/ajaxIndustryList"; //返回一个页面

}

ajaxIndustryList.jsp

               %24%7BraiseProject.coverImgUrl%20%7D

已完成

${raiseProject.name }

${raiseProject.projectIntro }

${raiseProject.minMoney }

已支持${raiseProject.supporterNum }

js

var currentPage = 1;

function getData() {// 分类,状态,排序

currentPage++;

var projectIndustry = $("#projectIndustry").val();

var projectStatus = $("#projectStatus").val();

var orderType = $("#orderType").val();

var key = $("#key").val();

$.ajax({

type : 'post',

url : '../client/ajaxFindProjectByCodition',

data : {

'projectIndustry' : projectIndustry,

'projectStatus' : projectStatus,

'orderType' : orderType,

"currentPage" : currentPage,

key : key

},

success : function(result) {

if (result == "" || result == null || result.length < 15) {

// $("#addMore").hide();

$("#addMore").html("已经是最后一页");

}

$('#selectDataId').append(result);//

增加返回的页面

}

});

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值