一个主网页(index.html)由四个框架(top.html、left.html、right.html、buttom.html)组成,我在头部(top.html)中的写了个退出链接,对它编写了JS的window.close()方法,使整个页面(index.html)退出。现在的情况是,点击了退出后,只是框架里的top.html退出了,要如何编码使得整个页面都退出?主页面没有body,代码如下:
<frameset rows="6%,*" cols="*">
<frame name="Top" src="top.html" noresize="noresize"  scrolling="no"/>
<frameset cols="20%,*">
<frame name="Left" src="../新建文件夹/Menu.html" noresize="noresize" scrolling="no"/>
<frame name="Right" src="../新建文件夹/BugMian.html" noresize="noresize" scrolling="no"/>
</frameset>
</frameset>
<noframes></noframes>top.html页面的的代码如下:
<html>
<script language="javascript">
window.onbeforeunload = function(){ 
return "您确定要退出页面吗?"; } 
</script>
<head>
<title>系统简介</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
.STYLE1 {font-size: medium}
-->
</style>
</head>
<body bgcolor="#0096e1" text="#000000"  topmargin="2">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr> 
    <td width="53%">&nbsp;&nbsp;&nbsp;&nbsp;<span class="STYLE1">BugEasy</span>
</td>
    <td valign="middle"> 
      <table border="0" align="right" cellpadding="0" cellspacing="0" width="100%">
        <tr> 
  <td width="100"><a href="../新建文件夹/editMyInformation.html" target="_blank">编辑我的信息</a></td>
          <td width="89"><a href="mailto:[email protected]">求助中心</a></td>
          <td width="91"><a href="SysInfo.html" target="_blank">系统简介</a></td>
    <td width="89"><a  href="">退出</a></td>
      </table>
    </td>
  </tr>
</table>
</body>
</html>

解决方案 »

  1.   

    刚改了一下,没有任何反应,只是在不停的刷新页面,不知道是不是写错了,我写的代码是:
    <a href="AdminIndex.html" target="top.location.herf='AdminIndex.heml'">退出</a>
      

  2.   

    <a href="AdminIndex.html" target="top.location.herf='AdminIndex.heml'">退出 </a>这个肯定不行的
    <a href=''>
      

  3.   

    <a href="javascript:void 0" target="top.location.herf='AdminIndex.html'">退出 </a>
      

  4.   

    改为window.parent.close()
    或者self.parent.close()