Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to close a parent window from a popup?

Status
Not open for further replies.

30101

Technical User
May 22, 2002
18
GB
Hello folks. I am a newbie
I have 2 Html pages, PageA htm and PageB htm. Page A is the parent page and it pop up pageB which is of same dimension as pageA. I want page A to automatically close within (1-3secs)when page B has the focus, since I can close Page B using a close button if I want to exit the program.
Is there a way of suppressing the warning message that comes up when I try to execute above scenario? (The web page you are viewing is trying to close the window .Do you want to close this window?)

step by step code please.

Thank you
eddie
eddy@lamuren.freeserve.co.uk
 
yes, for the most part ;-)

this seems to work for me in IE5+, NS6+, Moz1+ (on Windows)

from your child window:

opener.opener = self;
opener.close()

=========================================================
if (!succeed) try();
-jeff
 
Hi jeff,
Thanks for the suggestion, Excuse my ignorance where do I insert the code. I keep getting null error.. when I try to run the code.

Any ideals?

eddie
 
insert it where you want to execute it, such as...

in a button:
<input type=&quot;button&quot; value=&quot;Close Parent&quot; onclick=&quot;opener.opener = self; opener.close();&quot;/>

or after the child window loads:
<body onload=&quot;opener.opener = self; opener.close();&quot;> =========================================================
if (!succeed) try();
-jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top