JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old May 31st, 2005, 04:46 AM
hithere hithere is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2005
Posts: 1 hithere User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 51 sec
Reputation Power: 0
how to close parent window from child window

Hi,
I am having one asp page in which if certain conditions are not matched one pop up window is opened. In that i am having one close button which when clicked should close the new window as well as parent window.
But i am able to just close the new window not the parent window.
Can anyone please give me some sample code for this.
Any help will be appreciated.
Thanx in advance.

Reply With Quote
  #2  
Old May 31st, 2005, 06:21 AM
ChiefWigs1982's Avatar
ChiefWigs1982 ChiefWigs1982 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Location: I have emerged from the place of spells and fairies
Posts: 97 ChiefWigs1982 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 17 h 35 m 12 sec
Reputation Power: 14
You can't close windows you didn't create.

Reply With Quote
  #3  
Old June 1st, 2005, 08:16 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,886 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 19 m 35 sec
Reputation Power: 18
You might be better of redirecting to the new page, instead of opening the new page in a new window.
This way, you end up with one window of the new page.

a simple: window.location.href='whatever.htm'
instead of: window.open('whatever.htm','')

Reply With Quote
  #4  
Old June 24th, 2005, 02:03 PM
Cosiu Ronaldo Cosiu Ronaldo is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 1 Cosiu Ronaldo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 36 m 2 sec
Reputation Power: 0
how to close parent window from child window

Quote:
Originally Posted by hithere
Hi,
I am having one asp page in which if certain conditions are not matched one pop up window is opened. In that i am having one close button which when clicked should close the new window as well as parent window.
But i am able to just close the new window not the parent window.
Can anyone please give me some sample code for this.
Any help will be appreciated.
Thanx in advance.


Hey try this in your parent window!

MyWin = self.window;
MyWin.opener = self.window;

later in the child window do ...

MyWin.close();

If you don't know how to acces the parent's ... visit:

http://www.webdevelopersjournal.com/articles/dynamic_doc_creation.html

and read both articles ... they are great!

Hope this help a little.

best regards

Cosiu

Reply With Quote
  #5  
Old August 24th, 2008, 11:02 PM
Soniya123 Soniya123 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2008
Posts: 1 Soniya123 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 58 sec
Reputation Power: 0
To close a parent window from a Child window simply write this

window.opener.close();

It will help

Happy Javascript Programming
Soniya

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > how to close parent window from child window


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap