<head> <script type="text/javascript"> function gotopage(currentpage){ //统一调用此方法 var pagesize=document.getElementById("pagesize").value; window.location.href='${pageContext.request.contextPath}/servlet/ListCustomer currentpage='+currentpage+'&pagesize='+pagesize; } </script> </head> <body>......... 共[${pagebean.totalrecord}]条记录, 每页<input type="text" id="pagesize" value="${pagebean.pagesize}" onchange="gotopage(${pagebean.currentpage })" style="width:25px" maxlength="2">条记录, 共[${pagebean.totalpage }]页,当前第[${pagebean.currentpage }]页 <a href="javascript:void(0)" onclick="gotopage(${pagebean.previouspage})">上一页</a> <c:forEachvar="index" items="${pagebean.pagebar }"> //页码条 <c:if test="${pagebean.currentpage==index}"> //让当前被选中的页码红色显示并不具备连接功能 <font color="red">${index}</font> </c:if> <c:if test="${pagebean.currentpage!=index}"> <a href="javascript:void(0)" onclick="gotopage(${index})">${index }</a> </c:if> </c:forEach> <a href="javascript:void(0)" onclick="gotopage(${pagebean.nextpage})">下一页</a> <input type="text" id="page" value="${pagebean.currentpage }"> //Go功能 <input type="button" value="GO" onclick="gotopage(document.getElementById('page').value)"> </body> |
分页HTML代码
最新推荐文章于 2026-03-01 07:48:18 发布
本文详细介绍了如何在HTML中实现分页功能,包括使用纯HTML、CSS和JavaScript的方法,以及结合后台数据进行动态分页的策略,帮助开发者优化网页浏览体验。

1369

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



