ASM Wrote:
>
> may be with a timer ?
>
> <body onunload="setTimeout('popup.close()',10);">
>
> or
>
> <body onunload="setTimeout('popup.close()',0);">
>
> or
>
> <body onunload="popup.close();
> setTimeout('alert(\'I did close popup\')',100);">
>
Yea, I thought of the same thing and tried it, but if I put it in a
setTimeout the code never gets executed. I put an alert in and never saw
it. I tried 0, 10 and 100 for the times. I know that the line of code
where it sets the timeout is getting run because I put an alert after it and
I get that alert. This is really weird.
Anyways, after looking into it more, that's not actually where the problem
is. The problem is in the onunload code for the popup window. The popup
has an onunload that calls this function.
function closeCart()
{
if (window.opener)
{ window.opener.blCartIsOpen=false
window.opener.currCartSel=null
}
}
Now, I realized I had to add the window.opener part because I was getting an
error in Firefox as well that was saying that window.opener had no
properties. However, that condition solved the problem there. In IE, I am
still getting the Permission denied error. Somehow, it is getting through
the condition (meaning that window.opener still exists) but it is freaking
out when trying to set those variables. Any ideas what might be going on
here? I figure that if all else fails I can have the main window set a flag
that will keep this code from running when it closes it.
David
|