FAQ Topic - How do I check to see if a child window is open, before opening another? (2009-07-01)

F

FAQ server

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

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

Popup windows are generally best avoided.

http://msdn2.microsoft.com/en-us/library/ms533574.aspx

http://docs.sun.com/source/816-6408-10/window.htm#1201877


The complete comp.lang.javascript FAQ is at
http://jibbering.com/faq/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top