原页面是被框架分割了的,代码是这样的
<frameset cols="12%,*" border=10>
   
    <frame src="left.jsp" name="left" scrolling="no" noresize="noresize">
     <frame src="right.jsp" name="right">
   </frameset>
如果我在这个页面点击一个链接弹出一个新的页面,此时我想立即把原页面自动关闭,该如何实现?

解决方案 »

  1.   

    window.open(新页面的链接或action,'_blank','width=600,height=550,scrollbars=yes,resizable=yes');
    window.parent.close();试试看,不知道能否行,我也是个菜鸟,:)
      

  2.   

    这个我早就试过,不管用,你要知道父页面是用了frameset的
      

  3.   

    frame1.setVisible(false);这个行不行 
    点连接的时候做一个js在js里做关闭操作
      

  4.   


    function openAndClose(){  
        <!-- 下面是无提示关闭Temp1.html的代码 --> 
        var ua=navigator.userAgent  
        var ie=navigator.appName=="Microsoft Internet Explorer"?true:false  
        if(ie) {  
           var IEversion=parseFloat(ua.substring(ua.indexOf("MSIE ")+5,ua.indexOf(";",ua.indexOf("MSIE "))))  
           if(IEversion< 5.5) {  
              var str  = '<object id=noTipClose classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11">'  
              str += '<param name="Command" value="Close"></object>';  
              document.body.insertAdjacentHTML("beforeEnd", str);  
              document.all.noTipClose.Click();  
           }  
           else {  
              window.opener =null;  
              window.close();  
           }  
        }  
        else {  
           window.close()  
        }  
        <!-- 使用window.open链接Temp2.html --> 
        window.open('Temp2.html', '_black','height=400, width=600, status=no, menubar=no, resizable=no, scrollbars=no, toolbar=no, location=no, directories=no')  
    }  openAndClose();   
    </script>  <html>  
    <head>         
    <title>temp1.html</title>  
    </head>     
    <body>  
    <a href="xxxxxxxxx" onClick="openAndClose();">          
    </body>  
    </html>  
      

  5.   

    这样做也没有关闭原来的页面,只是弹出了新的页面,带有frameset的页面还在