不会写代码的阿龙 2021-10-29 17:49 采纳率: 25%
浏览 13

请教猿佬们,救救孩子吧!

为什么点击首页,上一页,下一页,尾页的时候会跳转到一个新的页面去呢?


<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%@ include file="/common/taglibs.jsp"%>

<%@page import="java.util.*"%>
<%@ page import="cn.com.circreport.reprint.model.ZGMiddleValue"%>

<html>
<style type="text/css">
    .container{
        position: absolute;
        margin-top: 30px;
        margin-left: 0px;
        left: 0px;
    }
    .title{
        font-size: 13px;
    }
    .tableFont{
        font-size: 10pt ;
    }
    .tableTopF{
        font-size: 10pt ;
        font-weight: bold;
    }
</style>

<script type="text/javascript">
    function managePage(filed){
        if(filed.name=="firstPage")
            fm.pageNo.value="1";
        if(filed.name=="previouPage"){
            if("1"==fm.pageNo.value){
                alert("当前已经是首页!")
                return false;
            }
            fm.pageNo.value=parseInt(fm.pageNo.value)-1;
        }
        if(filed.name=="nextPage"){
            if(fm.pageNumber.value==fm.pageNo.value){
                alert("当前已经是最后一页!")
                return false;
            }
            fm.pageNo.value=parseInt(fm.pageNo.value)+1;
        }
        if(filed.name=="tailPage")
            fm.pageNo.value=fm.pageNumber.value;
        fm.submit();
    }

</script>


<body>
<div class="col-lg-12">
    <form name="fm" action="/circreportnew/reprint/queryAllZgMiddleValues.do" target="fraUserSetInput">
        <table style="width: 96.5%;border-style: none;">
        <div align="center">
            <a style="color:blue;text-decoration:none;font-size: 11pt" href="${pageContext.request.contextPath}/reprint/queryAll.do">返回资管数据查询</a>&nbsp;&nbsp;&nbsp;
            <a style="color:blue;text-decoration:none;font-size: 11pt" href="${pageContext.request.contextPath}/reprint/ratio.do">比较上月</a>
        </div>
     <br/>
        <tr style="background-color: #D2F0F9;" align="center">
                <td class="tableTopF">YEARMONTH</td>
                <td class="tableTopF">ITEMNAME</td>
                <td class="tableTopF">ITEMVALUE</td>
                <td class="tableTopF">ITEMCODE</td>

            </tr>
            <%

                String yearMonth = "" ;
                String itemName = "" ;
                String itemValues ="";
                String itemCode = "" ;
                List<ZGMiddleValue> list = (List<ZGMiddleValue>)session.getAttribute("middleValueList") ;


                if(null != list && list.size() >0){
                    for(int i = 0 ; i < list.size() ; i++){
                        ZGMiddleValue zgMiddleValue = (ZGMiddleValue)list.get(i);

                        yearMonth = zgMiddleValue.getYearMonth();
                        itemName = zgMiddleValue.getItemName();
                        itemValues = zgMiddleValue.getItemValues();
                        itemCode = zgMiddleValue.getItemCode();

            %>

            <tr style="background-color: #D2F0F9;" align="center">
                <td class="tableFont"><%=yearMonth%></td>
                <td class="tableFont"><%=itemName%></td>
                <td class="tableFont"><%=itemValues%></td>
                <td class="tableFont"><%=itemCode%></td>
            </tr>

            <%
                    }
                }

            %>

            <tr style="background-color: #D2F0F9;">
                <td colspan="2">
                    <input type="hidden" name="pageNo" value="${pm.page }"/>
                    <input type="hidden" name="pageNumber" value="${pm.totalPages }"/>

                </td>
                <td colspan="8" align="center">
                    <input type="button" name="firstPage" value="首页" onclick="managePage(this)" style="background-color: #99CCFF;height=20px;width=50px;"/>
                    <input type="button" name="previouPage" value="上一页" onclick="managePage(this)"  style="background-color: #99CCFF;height=20px;width=50px;"/>
                    <input type="button" name="nextPage" value="下一页" onclick="managePage(this)"  style="background-color: #99CCFF;height=20px;width=50px;"/>
                    <input type="button" name="tailPage" value="尾页" onclick="managePage(this)"  style="background-color: #99CCFF;height=20px;width=50px;"/>
                    第${pm.page }页/共${pm.totalPages }页
                </td>
            </tr>

        </table>
    </form>
</div>
</body>

</html>

  • 写回答

1条回答 默认 最新

  • CodeMartain 2021-10-29 19:44
    关注

    超链接出遗漏了一个参数 target="" 默认是跳往空白页的,你可以选择以下 self什么的

    评论

报告相同问题?

问题事件

  • 创建了问题 10月29日

悬赏问题

  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥200 uniapp长期运行卡死问题解决
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?
  • ¥15 乘性高斯噪声在深度学习网络中的应用
  • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集