G Guest Feb 22, 2006 #1 1.) i want to open a browser when click a button the browser can only be open ONE only, no TWO can be open!
1.) i want to open a browser when click a button the browser can only be open ONE only, no TWO can be open!
K Karl Seguin [MVP] Feb 22, 2006 #2 var isOpen = false; function openWindow() { window.open(...); isOpen = true; } you can then place some code in the onUnload of the popup that'll set the parent's "isOpen" to false on close Karl
var isOpen = false; function openWindow() { window.open(...); isOpen = true; } you can then place some code in the onUnload of the popup that'll set the parent's "isOpen" to false on close Karl
R Rune B Feb 22, 2006 #3 - or consider assigning a name to the windows - it will basically do the same window.open("http://foo.com/", "myWindow"); R-)
- or consider assigning a name to the windows - it will basically do the same window.open("http://foo.com/", "myWindow"); R-)
L Laurent Bugnion Feb 22, 2006 #4 Hi, var isOpen = false; function openWindow() { window.open(...); isOpen = true; } you can then place some code in the onUnload of the popup that'll set the parent's "isOpen" to false on close Karl Click to expand... Why not use the window handle instead? var theWindow = null; function openWindow() { theWindow = window.open( ... ); } then: if ( theWindow && !theWindow.closed ) { theWindow.close(); theWindow = null; } HTH, Laurent
Hi, var isOpen = false; function openWindow() { window.open(...); isOpen = true; } you can then place some code in the onUnload of the popup that'll set the parent's "isOpen" to false on close Karl Click to expand... Why not use the window handle instead? var theWindow = null; function openWindow() { theWindow = window.open( ... ); } then: if ( theWindow && !theWindow.closed ) { theWindow.close(); theWindow = null; } HTH, Laurent
K Karl Seguin [MVP] Feb 22, 2006 #5 good thinking you can also close()the window and access the closed boolean property. karl