Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 13th, 2006, 05:27 AM
Friend of Wrox
 
Join Date: Sep 2004
Location: Tehran, Tehran, Iran.
Posts: 103
Thanks: 0
Thanked 0 Times in 0 Posts
Default getting all pop-ups

hi all,
   How shall I get the windows objects of all the pop-ups which have been opened through a certain page(via window.open call) just like the way one can get all of the window objects of child frames of a page through window.frames collection(and I don't want to save all the handlers of the pop-ups while opening them in order to close them later).


Reply With Quote
  #2 (permalink)  
Old February 14th, 2006, 04:59 PM
nzakas's Avatar
Wrox Author
 
Join Date: Dec 2004
Location: Peabody, MA, USA.
Posts: 217
Thanks: 0
Thanked 5 Times in 5 Posts
Default

You can only do that by keeping track of them when they're opened, such as:
Code:
var popups = new Array();

function openWindow(sURL, sName, sFeatures) {
    var oPopup = window.open(sURL, sName, sFeatures);
    popups.push(oPopup);
    return oPopup;
}
Then use the openWindow() function whenever you want to open a new window. Each new instance will be saved in the popups array.

Nicholas C. Zakas
Author, Professional JavaScript for Web Developers (ISBN 0764579088)
http://www.nczonline.net/
Reply With Quote
  #3 (permalink)  
Old February 26th, 2006, 08:25 AM
Friend of Wrox
 
Join Date: Sep 2004
Location: Tehran, Tehran, Iran.
Posts: 103
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks but as I mentioned I don't tend to it this way.
if there were such a property in window object (for example childWindows[] )
then I could simply run a recursive function and close all open popups through any frame or popup when the user signs out in a complex portal...
Reply With Quote
  #4 (permalink)  
Old March 7th, 2006, 01:22 AM
Authorized User
 
Join Date: Feb 2006
Location: Bay Area, CA, USA.
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to dimo414 Send a message via Yahoo to dimo414
Default

nzakas, but doesn't the variable oPopup only work inside the funtion openWindow?

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Balloon pop-ups Cyber Shiva Javascript How-To 1 June 18th, 2008 01:08 PM
Explanatory pop-ups / second window ... asearle XSLT 6 January 8th, 2007 09:12 AM
Newbie Question RE Image pop ups Nostromo77 ASP.NET 2.0 Basics 0 December 10th, 2006 07:31 PM
open multiple pop-ups aspenthu ASP.NET 1.0 and 1.1 Professional 1 May 20th, 2006 04:02 AM



All times are GMT -4. The time now is 06:58 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.