| |

VerySource

 Forgot password?
 Register
Search
View: 15|Reply: 6

A frame page, how to determine whether window.parent.opener is closed? ?

[Copy link]

2

Threads

3

Posts

4

Credits

Newbie

Rank: 1

Credits
4

 China

Post time: 2020-2-14 10:30:01
| Show all posts |Read mode
How to determine whether window.parent.opener is closed. Window.parent.opener is closed. When taken out with js, window.parent.opener is not equal to null.
Reply

Use magic Report

0

Threads

2

Posts

2

Credits

Newbie

Rank: 1

Credits
2

 China

Post time: 2020-4-13 21:00:02
| Show all posts
if (window.parent.opener) {
     Did not close
} else {
     It has been closed
}
Reply

Use magic Report

0

Threads

2

Posts

2

Credits

Newbie

Rank: 1

Credits
2

 China

Post time: 2020-4-13 21:30:01
| Show all posts
if (window.parent.opener) {
    Did not close
} else {
    It has been closed
}
Reply

Use magic Report

0

Threads

26

Posts

16

Credits

Newbie

Rank: 1

Credits
16

 China

Post time: 2020-4-15 17:30:01
| Show all posts
Should it be if (window.parent.opener.close ())? Never used, haha
Or is it window.parent.opener = "undefine"? It feels unreasonable
Reply

Use magic Report

0

Threads

4

Posts

5

Credits

Newbie

Rank: 1

Credits
5

 China

Post time: 2020-5-6 21:45:02
| Show all posts
window.parent.opener.closed? "Closed": "Not closed"
Reply

Use magic Report

0

Threads

5

Posts

6

Credits

Newbie

Rank: 1

Credits
6

 China

Post time: 2020-5-7 01:45:01
| Show all posts
var 7660367 = window.parent.opener;

if (typeof (7660367)! = "undefined"&&! 7660367.closed)
{
    ; //
}
Reply

Use magic Report

2

Threads

3

Posts

4

Credits

Newbie

Rank: 1

Credits
4

 China

 Author| Post time: 2020-6-24 22:00:01
| Show all posts
function shutwin()
{
     var wp = window.parent.opener;
        if(wp!=null&&typeof(wp) != "undefined"&&!wp.closed)
        {
            if (wp.document.forms[0].txtRefreshParent != null)
            {
                wp.document.forms[0].txtRefreshParent.value="Refresh";
            }
            else
            {
               if(wp.document.forms[0].ctl00_MainPlaceHolder_txtRefreshParent!=null)
               {
                   wp.document.forms[0].ctl00_MainPlaceHolder_txtRefreshParent.value="Refresh";
               }
            }
            wp.document.forms[0].submit();
        }
    window.parent.close();
}
In fact, wp is closed, but why is wp.closed equal to true, and typeof(wp)="object", why? ? ?
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2020|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list