本文主要是介绍ibatis 分页 06_page1.js,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
page1.js
$(document).ready(function(){//选择第n页下拉框$("#select_page").change(function(){var rows = $("#rows").val();var pre = $("#select_page option:selected").val();var total = $("#total").val();rows = $.trim(rows);total = $.trim(total);rows = Number(rows);total = Number(total);var reg = /^[0-9]{1,}$/;if(!reg.exec(rows)){alert("请输入正整数");return null;}if(rows==0 || rows<0){alert("必须大于0");return null;}if(rows > total){alert("不能大于总记录数");return null;}window.location = "getUsersPage.action?pre="+pre+"&rows="+rows;});//输入每页显示的行数,点击"go"按钮$("#go_btn").click(function(){var total = $("#total").val(); var rows = $("#rows").val();rows = $.trim(rows);total = $.trim(total);rows = Number(rows);total = Number(total);var reg = /^[0-9]{1,}$/;if(!reg.exec(rows)){alert("请输入正整数");return null;}if(rows==0 || rows<0){alert("必须大于0");return null;}if(rows > total){alert("不能大于总记录数");return null;}window.location = "getUsersPage.action?pre=1&rows="+rows;});
});/*** 分页*///上一页
function topr(obj){var pre = obj.href.split('#')[1]; var rows = $("#rows").val();var total = $("#total").val();rows = $.trim(rows);total = $.trim(total);rows = Number(rows);total = Number(total);var reg = /^[0-9]{1,}$/;if(!reg.exec(rows)){alert("请输入正整数");return null;}if(rows==0 || rows<0){alert("必须大于0");return null;}if(rows > total){alert("不能大于总记录数");return null;}if(pre != 0){window.location = "getUsersPage.action?pre="+pre+"&rows="+rows;}}//下一页
function tonx(obj){var pre = obj.href.split('#')[1]; var rows = $("#rows").val();var total = $("#total").val();rows = $.trim(rows);total = $.trim(total);rows = Number(rows);total = Number(total);var reg = /^[0-9]{1,}$/;if(!reg.exec(rows)){alert("请输入正整数");return null;}if(rows==0 || rows<0){alert("必须大于0");return null;}if(rows > total){alert("不能大于总记录数");return null;}window.location = "getUsersPage.action?pre="+pre+"&rows="+rows;
}
这篇关于ibatis 分页 06_page1.js的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!