Hi All
I have an application using IE only as the client. The app sometimes opens popup windows for various reasons/functions. I open the popup with this ('xpopup' is a global JavaScript variable):
xpopup = window.open(url,"",features);
On closing the popup I set xpopup to false. On closing the main window I test for an open popup window and if there is one I close it with this code:
function window.onunload(){
if(xpopup){
xpopup.close();
}
}
I also have code to make the popup modal (On focus of main window I test xpopup and if it is set I focus the popup).
I know I can open a modal window in IE but I don't want to use IE only features if possible (I do already and I am trying to remedy that).
So my questions:
1. Has anyone else implemented a generic 'modal' popup solution?
2. Is there a better way to test for an open popup, i.e. child window? (If I forget to reset xpopup to false when a popup closes then a 'focus' on the main window tries to focus the popup, which is closed, and I get an error. Also handling a popup from a popup is problematic (nested popups).)
Thanks
Cheers
Richard
I have an application using IE only as the client. The app sometimes opens popup windows for various reasons/functions. I open the popup with this ('xpopup' is a global JavaScript variable):
xpopup = window.open(url,"",features);
On closing the popup I set xpopup to false. On closing the main window I test for an open popup window and if there is one I close it with this code:
function window.onunload(){
if(xpopup){
xpopup.close();
}
}
I also have code to make the popup modal (On focus of main window I test xpopup and if it is set I focus the popup).
I know I can open a modal window in IE but I don't want to use IE only features if possible (I do already and I am trying to remedy that).
So my questions:
1. Has anyone else implemented a generic 'modal' popup solution?
2. Is there a better way to test for an open popup, i.e. child window? (If I forget to reset xpopup to false when a popup closes then a 'focus' on the main window tries to focus the popup, which is closed, and I get an error. Also handling a popup from a popup is problematic (nested popups).)
Thanks
Cheers
Richard