HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 29th, 1999, 02:02 PM
sryder
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Okay somebody out there must know how to do this. I have a script to open a new window, nothing overly difficult. But than I would like to open another one off the Flash File. If the user leaves the first open the new one goes in there and it does not use the proper variables to size the window. Is there a way to close a window from outside the window (by naming it or whatever) so that when I click on another link it opens a totally new one ? I have been told that there is a script that closes one window before opening another, anyone that can help me ?

Thanks

------------------
Shawn Ryder
Multimedia Designer
http://www.learningdesignstudios.com

Reply With Quote
  #2  
Old December 29th, 1999, 03:50 PM
mroberts
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
If I understand you correctly, you have a browser open, you click a link and want a new window to open, you then click another link to open a third window(including browser) then you want to close the second window. The problem you are having is that the page you want to come up in the third window is coming up in the second. If this is the case, when you open the third window, specify a different name as you thought. To close the second window that called the third window, use the following:

<head>
<script language="JavaScript">
window.opener.close();
</script>
</head>


If this doesn't work, let me know.

mroberts@naxs.com

Reply With Quote
  #3  
Old December 30th, 1999, 08:15 AM
sryder
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Thanks for the help, but I am a little confused. Does the code go in the HEAD of the original browser window or in the second one ? and if it goes in the first how do you call on the function ?

------------------
Shawn Ryder
Multimedia Designer
http://www.learningdesignstudios.com

Reply With Quote
  #4  
Old January 4th, 2000, 08:09 AM
mroberts mroberts is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 1999
Location: Bristol, VA USA
Posts: 6 mroberts User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
You can't close the window that is going to open the new window because it will never process the code to open the new window. You can try two things: First you can open the new window, then at the end of your program do a window.close or self.close (this code will go in the window that you want to close) or you can open the new window and the first piece of code that will be processed is the code that I sent earlier. Just remember that the computer processes code from the top going down. You have to open the new window before you can close the window that is calling the new window.

If you do it the first way: call your function to open the new window, then the last piece of code in your program, do a window.close() or self.close() ... you can do this right before your end </body> tag(put in the <script language="JavaScript">window.close() or self.close()</script>.

If you do it the second way: open the new window as you normally would (name it differently), then put the code snippet that I sent you in the head of the most recently opened window. (the last one opened) That way, the first thing that will happen in the newest window will be to close the window that called the newest window.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > Need some help with pop up windows


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway