var pageData={page:1,pageSize:2 };
$.ajax({
async: true,
type: "post",
url: "user/showAllUser.do",
traditional: true,
data:pageData,
dataType: "json",
cache: true,
success: function(data) {
});
$.ajax({
async: true,
type: "post",
url: "user/showAllUser.do",
traditional: true,
data:pageData,
dataType: "json",
cache: true,
success: function(data) {
alert(data)
window.location.href = "/manageSystem/user/mytest.do" //经测试这里的url是要写上项目名的
//$("#mybody").html("点击<a href='/manageSystem/user/mytest.do'>此处</a>跳转。");
});
本文介绍了一种利用jQuery库发起Ajax请求实现分页显示数据的方法。通过设置页面大小和当前页数,向服务器发送POST请求获取用户数据,并在成功回调中处理返回的数据。文章还涉及了如何设置Ajax请求的基本属性如异步执行、数据类型等。
44

被折叠的 条评论
为什么被折叠?



