weixin_42371570 2010-05-21 14:38
浏览 614
已采纳

关于在html的框架(frame)下,要实现退出系统的功能,该如何设计代码?

比如我一个页面分成两部分






在1.jsp中, 设计一个”退出系统“的选项,点击“退出系统”就可以退出系统,那该怎么设计呢?我的代码是:


        <tr bgcolor="#E1F0FF">
            <td language="javascript" onmouseup="opencat2(cat101002,img101002);" id="item$pval[CatID])" onmouseover="this.bgColor='#A2DBCE';" style="CURSOR: hand" onmouseout="this.bgColor='#E1F0FF';" height="24">
                <img id="img101002" height="20" src="img/class1.gif" width="20" align="absMiddle" />
                课程管理
            </td>
        </tr>
        <tr>
            <%-- 类型树--%>
            <td id="cat101002" style="DISPLAY: none" bgcolor="#fefdf5">
                <img height="20" src="img/class3.gif" width="36" align="absMiddle" border="0" alt="" />
                <a target="mainFrame" href="jsp/paike/kebiaochaxun.jsp">课表查询</a><br />
                <img height="20" src="img/class3.gif" width="36" align="absMiddle" border="0" alt="" />
                <a target="mainFrame" href="jsp/paike/xuankequeren.jsp">选课确认</a><br />

                <img height="20" src="img/class3.gif" width="36" align="absMiddle" border="0" alt="" />
                <a target="mainFrame" href="jsp/xinxiluru/xinxiluru.jsp">其它信息录入</a><br />
            </td>
        </tr>
        <tr bgcolor="#E1F0FF">
            <td language="javascript" onmouseup="opencat3(cat101003,img101003);" id="item$pval[CatID])" onmouseover="this.bgColor='#A2DBCE';" style="CURSOR: hand" onmouseout="this.bgColor='#E1F0FF';" height="24">
                <img id="img101003" height="20" src="img/class1.gif" width="20" align="absMiddle" />
                教师信息管理
            </td>
        </tr>
        <tr>
            <%-- 类型树--%>
            <td id="cat101003" style="DISPLAY: none" bgcolor="#fefdf5">
                <img height="20" src="img/class3.gif" width="36" align="absMiddle" border="0" alt="" />
                <a target="mainFrame" href="jsp/paike/laoshiluru.jsp">信息录入</a><br />
                <img height="20" src="img/class3.gif" width="36" align="absMiddle" border="0" alt="" />
                <a target="mainFrame" href="jsp/paike/laoshiweihu.jsp">信息维护</a><br />
            </td>
        </tr>
        <tr bgcolor="#E1F0FF">
            <td language="javascript" onmouseup="opencat4(cat101004,img101004);" id="item$pval[CatID])" onmouseover="this.bgColor='#A2DBCE';" style="CURSOR: hand" onmouseout="this.bgColor='#E1F0FF';" height="24">
                <img id="img101004" height="20" src="img/class1.gif" width="20" align="absMiddle" /> 
                课程信息管理</td>
        </tr>
        <tr>
            <%-- 类型树--%>
            <td id="cat101004" style="DISPLAY: none" bgcolor="#fefdf5">
                <img height="20" src="img/class3.gif" width="36" align="absMiddle" border="0" alt="" /> 
                <a target="mainFrame" href="jsp/paike/kechengluru.jsp">信息录入</a><br />
                <img height="20" src="img/class3.gif" width="36" align="absMiddle" border="0" alt="" /> 
                <a target="mainFrame" href="jsp/paike/kechengweihu.jsp">信息维护</a><br />
            </td>
        </tr>
        <tr bgcolor="#E1F0FF">
            <td language="javascript" onmouseup="opencat5(cat101005,img101005);" id="item$pval[CatID])" onmouseover="this.bgColor='#A2DBCE';" style="CURSOR: hand" onmouseout="this.bgColor='#E1F0FF';" height="24">
                <img id="img101005" height="20" src="img/class1.gif" width="20" align="absMiddle" /> 
                教室信息管理</td>
        </tr>
        <tr>
            <%-- 类型树--%>
            <td id="cat101005" style="DISPLAY: none" bgcolor="#fefdf5">
                <img height="20" src="img/class3.gif" width="36" align="absMiddle" border="0" alt="" /> 
                <a target="mainFrame" href="jsp/paike/jiaoshiluru.jsp">信息录入</a><br />
                <img height="20" src="img/class3.gif" width="36" align="absMiddle" border="0" alt="" /> 
                <a target="mainFrame" href="jsp/paike/jiaoshiweihu.jsp">信息维护</a><br />
            </td>
        </tr>
        <tr bgcolor="#E1F0FF">
            <td language="javascript" onmouseup="opencat6(cat101006,img101006);" id="item$pval[CatID])" onmouseover="this.bgColor='#A2DBCE';" style="CURSOR: hand" onmouseout="this.bgColor='#E1F0FF';" height="24">
                <img id="img101006" height="20" src="img/class1.gif" width="20" align="absMiddle" /> 
                课程安排</td>
        </tr>
        <tr>
            <%-- 类型树--%>
            <td id="cat101006" style="DISPLAY: none" bgcolor="#fefdf5">
                <img height="20" src="img/class3.gif" width="36" align="absMiddle" border="0" alt="" /> 
                <a target="mainFrame" href="jsp/paike/kechenganpai.jsp">课程安排</a><br />
            </td>
        </tr>

        <tr bgcolor="#E1F0FF">
            <td language="javascript" onmouseup="opencat8(cat101008,img101008);" id="item$pval[CatID])" onmouseover="this.bgColor='#A2DBCE';" style="CURSOR: hand" onmouseout="this.bgColor='#E1F0FF';" height="24">
                <img id="img101008" height="20" src="img/class1.gif" width="20" align="absMiddle" /> 
                退出系统</td>
        </tr>
        <tr>
            <%-- 类型树--%>
            <td id="cat101008" style="DISPLAY: none" bgcolor="#fefdf5">
                <img height="20" src="img/class3.gif" width="36" align="absMiddle" border="0" alt="" /> 
                <a target="mainFrame" href="jsp/tuichu/tuichu.jsp">退出系统</a><br />
            </td>
        </tr>
    </table>



但是退出系统,只能转到一个有框架的页面,我的页面分成了两个框架,一个是muluFrame在左面,一个是mainFrame在右面,当我点击“退出系统”后,”退出系统“的链接tuichu.jsp显示在mainFrame中,不能真正意义上实现退出系统的功能?我应当怎样设计呢?
下面是我上传的工程源码及数据库文件

  • 写回答

3条回答

  • myali88 2010-05-21 16:22
    关注

    html部分:
    [code="javascript"]
    退出系统
    [/code]
    JS部分:
    [code="java"]
    function logout(){
    parent.window.location = "<%=request.getContextPath()%>/jsp/tuichu/tuichu.jsp";
    }
    [/code]

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 全志H618ROM新增分区
  • ¥20 jupyter保存图像功能的实现
  • ¥15 在grasshopper里DrawViewportWires更改预览后,禁用电池仍然显示
  • ¥15 NAO机器人的录音程序保存问题
  • ¥15 C#读写EXCEL文件,不同编译
  • ¥15 MapReduce结果输出到HBase,一直连接不上MySQL
  • ¥15 扩散模型sd.webui使用时报错“Nonetype”
  • ¥15 stm32流水灯+呼吸灯+外部中断按键
  • ¥15 将二维数组,按照假设的规定,如0/1/0 == "4",把对应列位置写成一个字符并打印输出该字符
  • ¥15 NX MCD仿真与博途通讯不了啥情况