Click to See Complete Forum and Search --> : Window opened ONLY when the calling window is closed...


dmason165
04-06-2003, 10:53 AM
Good day to all!!

I have the following function:

function AreYouSure() {
var agree=confirm("Confirm your decision.\nClick OK to open the homepage to this site.\nClick CANCEL to exit.");
if (agree) {
window.open("/DarronMason's/ProposalToAIGClaimsDepartment/Welcome/Home/1/~.htm",'',',toolbar=no,resizable=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=no');
window.close();
}
else {
window.close();
}
}

IE asks the user if he/she would like to close the window, but it still opens the other window. What I need this to do is wait until the calling page is closed (the user selects "YES") before it opens the new window. This way, if the user selects "NO" when asked by IE if they would like the page to close, the other page will not open. I want the page being called to open ONLY when the calling window is closed.

Thanks in advance for your help and your time.

~dmason165

AdamGundry
04-06-2003, 10:57 AM
Try this:

if (agree==1) {

I'm not certain, but that could be what you are missing.

Adam

dmason165
04-06-2003, 11:06 AM
I tried that but what happened was the page being called didn't display its content, which is what I want, but the calling page didn't close.

Any other suggestions?

Thanks.

~D

khaki
04-06-2003, 11:20 AM
Hi dmason165...
try this
;) k

<script language="javascript">
var agree=window.confirm("Confirm your decision.\nClick OK to open the homepage to this site.\nClick CANCEL to exit.");
if (agree)
{
window.open('yourPage.htm','','toolbar=no,resizable=no,location=no,status=yes,menubar=no,scrollbars= yes,resizable=no');
window.close();
}
else
{
}
</script>