We have a browser window which displays a menu in the main page and on
user's selection pops up another browser window with some DHTML
content.
On the parent window the user has hyperlinks for sign-out.
We need to:
1. Request the user to confirm whether he really wants to signout (or
close the parent window, if he clicks on browser close (X) button).
2. Close the child popup window if the parent window is closed or user
selects the Sign-Out.
3. Get to know what the user clicked to close the parent window.
Please note we have a menu in the main page, so the user can navigate
away from the page where the child browser window was popped up from
initially. We should be able to close the child window even from a
page (in the parent window) which did not open it.
Here is the code that we have already tried:
***************************************************************
<script language=javascript>
function unLoadFncIE(evt){
var e = (window.event) ? window.event : evt; if(e.clientY<0){return
"Closing this window will close the child window too.";} }
var childWnd ;
function closeDep() {
if (childWnd && childWnd.open && !childWnd.closed)
childWnd.close(); } function openWindow(){
childWnd = window.open("./childwindow.htm", "ChildWind", ""); } </script>
<body onbeforeunload="return unLoadFncIE(event);" onunload="return
unLoadFullyFncIE();">
***************************************************************
But this works only from the page that opened the child window.
Thanks,
Regards,
K. Dev |