By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,332 Members | 1,057 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,332 IT Pros & Developers. It's quick & easy.

FAQ Topic - How do I check to see if a childwindow is open, before opening another?

P: n/a
-----------------------------------------------------------------------
FAQ Topic - How do I check to see if a childwindow is open, before opening another?
-----------------------------------------------------------------------

var myWin=null;
function openWin(aURL) {
if (!myWin || myWin.closed ) {
myWin=window.open(aURL,'myWin');
} else{
myWin.location=aURL;
myWin.focus();
}
}

http://msdn.microsoft.com/workshop/a...ies/closed.asp

http://docs.sun.com/source/816-6408-...ow.htm#1201877
===
Postings such as this are automatically sent once a day. Their
goal is to answer repeated questions, and to offer the content to
the community for continuous evaluation/improvement. The complete
comp.lang.javascript FAQ is at http://www.jibbering.com/faq/.
The FAQ workers are a group of volunteers.

Oct 19 '06 #1
Share this Question
Share on Google+
1 Reply

P: n/a
FAQ server wrote on 20 okt 2006 in comp.lang.javascript:
-----------------------------------------------------------------------
FAQ Topic - How do I check to see if a childwindow is open, before
opening another?
-----------------------------------------------------------------------
The above question does not cover the problem, perhaps:

How only to open a new named window,
if a window with that name isn't open yet?

or just:

How to open an URL in a window named 'myWin'?
var myWin=null;
function openWin(aURL) {
if (!myWin || myWin.closed ) {
myWin=window.open(aURL,'myWin');
} else{
myWin.location=aURL;
myWin.focus();
}
}
I would prefer a function like this:

function openWin(aURL, aWinName) {...}

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Oct 19 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.