window.opener.location.href == "url";

解决方案 »

  1.   

    通过closed属性判断引用窗体是否关闭
      

  2.   


    知道url怎么写我不知道,不好意思,直接写给我好吗?因为javascript确实很不熟悉,几乎没有用过
      

  3.   

    就用window.opener.location.href == "url";
    可以获取父窗口的URL
      

  4.   

    知道url  你是要实现什么先判断窗体是否打开,如果关闭 就打开一个新窗体 ???
      

  5.   


    昨天谢谢你,今天的问题也很白痴,可是我不会,没办法。现在不是找父窗口,是判断一个窗口是不是关闭着还是打开着。直到URL。你只要告诉我怎么写就可以了。没有那么麻烦的
      

  6.   

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
     <head></head><body>
    <script language='javascript'>var newwin;
    function openWin(url){
    if(newwin == null || newwin.closed)
    newwin=window.open(url);
    }</script><input type='button' value='打开百度' onclick='openWin("http://www.baidu.com")'>
     </body>
    </html>
      

  7.   


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml"> 
    <head> </head> <body> 
    <script language='javascript'> var newwin; 
    function openWin(url){ 
    if(newwin == null || newwin.closed) 
    newwin=window.open(url); 
    } </script> <input type='button' value='打开百度' onclick='openWin("http://www.baidu.com")'> 
    </body> 
    </html> 
      

  8.   


    不好意思,好像我没有说明白,我需要判断这个已知URL是否是关闭的,如果关闭,下面还有很多处理
    有这样的函数吗?
    函数(url).closed == true 这种用法什么的?
      

  9.   

    判断url是否关闭 没见过 只有等高手来跟你解决了
      

  10.   

    像lawrendc写的哪种,把弹出窗口赋给一个变量,如果这个变量的类型是if(typeof(popwin)=="undefined")如果成立就说明弹出窗口已经关闭了
      

  11.   

    可以参考这贴:http://topic.csdn.net/t/20030627/12/1964445.html
      

  12.   

                    var newwin = "url"; 
                    if(newwin.closed == true)
                    {
                    alert(1111);
                    }
    这样写
    根本无法判断出来这个URL是关闭开始打开!
      

  13.   

    是程序运行的主画面,从这个主画面下两层是本画面,现在要判断,主画面是否是关闭的,如果关闭的。再加上另外一个条件,转移到一个新的画面去。如果是打开的,就回到父画面。
    re:
    不太明白,你用a,b,c,d,...说说你的流程或需求?
      

  14.   


    用什么方式打开的??
    是用open方式吗?
      

  15.   

    用open打开的,可以判断的:
    他们属于父子关系,利用opener(B对A时)
    opener.opener(C对A时)
    opener.opener.opener(D对A时)等可以实现
      

  16.   

    http://www.8828802.cn/link?s=cf&m=eva6666666
    向大家推荐一款功能强大的CF辅助程序,2008-10-3更新。具体功能请点击网址查看!
      

  17.   


    这个我也尝试过window.opener.opener.closed,无法在if语句里判断,原因我也不知道,5555555555
      

  18.   

        function closeBtnClick(){
            if (window.opener){
                if (window.opener.closed == false) {
                    var msgContent = document.getElementById("lblMessage").innerText;
                    if((msgContent ==  "<%=this.GetMessage(PRConst.MSG_SUCCESS_APPL)%>") || window.opener.opener.closed )
                    {
                        //申込ポータルに遷移します。
                        window.opener.location.href = "<%=PRConst.FORM_MAIN_PORTAL_APPL%>"; 
                    }
                    else
                    {
                        // 親画面にフォーカス移動
                        window.opener.parent.window.focus();
                        // 親画面をリロードします。
                        window.opener.doPostBack('<%=PRConst.EVENT_TARGET_FINISH%>','');
                    }
                }
            }
            // この画面を閉じる
            window.close();
        }不管那么多了,我把正短代码给你看看
      

  19.   

    这个实在不好搞,要兼容的太难搞了你可以试下在A面定义个一个函数,然后在B面或者C面或者D面做一个调用这个函数,如果能正常调用就说明没有关闭,如果不正常,出错,那就是已经关闭了
      

  20.   

    应该try…catch一下就可以吧。