Prev: How to remove an element?
Next: Background changes to blue color when a popup is moved across in IE8
From: FAQ server on 19 Jun 2010 19:00 ----------------------------------------------------------------------- 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 cause usability problems and are generally best avoided. https://developer.mozilla.org/en/DOM:window.open http://msdn.microsoft.com/en-us/library/ms533574%28VS.85%29.aspx http://docs.sun.com/source/816-6408-10/window.htm#1201877 http://www.useit.com/alertbox/990530.html The complete comp.lang.javascript FAQ is at http://jibbering.com/faq/ -- The sendings of these daily posts are proficiently hosted by http://www.pair.com. |