In comp.lang.javascript message <45d4f406$0$90267$14726298@news.sunsite.
dk>, Fri, 16 Feb 2007 00:00:01, FAQ server <javascript@dotinternet.be>
posted:
Quote:
>-----------------------------------------------------------------------
>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();
}
}
The code, which is accompanied only by links, answers the question "How
do I check to see if the specific childwindow 'myWin' exists and is
open, open it if it exists and is closed, and otherwise create and
focus it ?", which is a different question. Either the question or the
answer should be changed.
I suppose there should be a way of enumerating childwindows; then one
can test to see which are open and which are not.
--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk DOS 3.3, 6.20 ; WinXP.
Web <URL:http://www.merlyn.demon.co.uk/- FAQqish topics, acronyms & links.
PAS EXE TXT ZIP via <URL:http://www.merlyn.demon.co.uk/programs/00index.htm>
My DOS <URL:http://www.merlyn.demon.co.uk/batfiles.htm- also batprogs.htm.