[Javascript] Can a reloaded parent window close its child?

Hakan M. hakan at backbase.com
Mon Dec 29 04:06:31 CST 2003


Him/her? We're not getting a bit too dramatic here? ;)

A simple guess; The parent (document) forget about it's child since the 
instance (or session, if you wish) is lost when the page is reloaded. 
Quite naturally, we lose all the local variables we declared in the 
parent as well, this is normal behaviour.

The child, however, probably only has a reference to the window from 
which it was spawned, not the document element inside that window. 
Naturally, that window reference will still be valid even when we reload 
or change the page.

I'm not saying this is how it is, but it makes most sense to me.

I wouldn't recommend using one of the dreaded popup windows for your 
loading sign anyway. Mozilla users will block it, and the script won't work.

2 cents,
Hakan.

BEKIM BACAJ wrote:
> Sad but true, the child will recognise this new clone as his real parent 
> and will interact wit him/her. Because both, the real father and the 
> newer clone have same container origin. It will send a "message" to 
> Mommy and will be able to ask her to freshen her memory, but it will do 
> no good, the newer clone will never be able to recall the memory it 
> never had. The connection will be llost because the real parent has 
> vanished forever.
> But I will try to look into this matter later, if I come to any solution 
> I will repply as soon as possible.
> 
> 
>> From: Paul Novitski <javascriptlist at dandemutande.org>
>> Reply-To: "[JavaScript List]" <javascript at LaTech.edu>
>> To: "[JavaScript List]" <javascript at LaTech.edu>,javascript at LaTech.edu
>> Subject: RE: [Javascript] Can a reloaded parent window close its child?
>> Date: Sat, 27 Dec 2003 09:38:56 -0800
>>
>> And to further complicate this sad affair, the orphaned child still 
>> recognizes its parent, even though the cruel parent has forgotten its 
>> child.
>>
>> The child can interact with the parent [clone] even after it's reloaded:
>>         window.opener.document.ParentForm.ParentTextbox.value = "Mommy!";
>> and can even reload the parent with:
>>         window.opener.document.location.reload();
>> and still not lose the connection.
>>
>> If anyone has an idea how to bypass this problem of the amnesiac 
>> parent, I'd be grateful.
>>
>> Paul
>>
>>
>> At 06:27 AM 12/27/2003, BEKIM BACAJ wrote:
>>
>>> Obvious and not obvious sametime
>>> All the pages wiewed on browser win are to be considered as 'clones' 
>>> of the original generator.
>>> So if one clone has a child, the other is not awear of it. Since a 
>>> reloaded page is just another clone, the last child does not belong 
>>> to him, because he is younger than this child and doesn't have any 
>>> knowlledge of existance of his other clones nor his other relatives. 
>>> Even if this child can be legaly proclaimed as a child of reloaded 
>>> window, it isn't, a paradox that awaits our civilisation on horizon...
>>>
>>>> From: Paul Novitski <javascriptlist at dandemutande.org>
>>>> Reply-To: "[JavaScript List]" <javascript at LaTech.edu>
>>>> To: "[JavaScript List]" <javascript at LaTech.edu>
>>>> Subject: [Javascript] Can a reloaded parent window close its child?
>>>> Date: Fri, 26 Dec 2003 23:41:01 -0800
>>>>
>>>> I want my browser window to create a child window that says "Please 
>>>> wait" while the parent window is reloading.  Unfortunately, when the 
>>>> parent has reloaded, it appears to have forgotten the identity of 
>>>> the child:
>>>>
>>>> body onLoad="jsCloseChild();" onUnLoad="jsCreateChild();"
>>>>
>>>> The close function fails when I use either of these two techniques 
>>>> for creating and naming the child:
>>>>
>>>> =====================================
>>>> function jsCreateChild(){
>>>>         window.open('PleaseWaitChild.html', 'MyChild', '');
>>>> }
>>>> function jsCloseChild(){
>>>>         MyChild.close;
>>>> }
>>>> =====================================
>>>> var MyChild;
>>>> function jsCreateChild(){
>>>>         MyChild=window.open('PleaseWaitChild.html', 'WindowName', '');
>>>> }
>>>> function jsCloseChild(){
>>>>         MyChild.close;
>>>> }
>>>> =====================================
>>>> Can anyone provide a solution?
>>>>
>>>> Thanks,
>>>> Paul
>>>>
>>>>
>>>> _______________________________________________
>>>> Javascript mailing list
>>>> Javascript at LaTech.edu
>>>> https://lists.LaTech.edu/mailman/listinfo/javascript
>>>
>>>
>>> _________________________________________________________________
>>> The new MSN 8: advanced junk mail protection and 2 months FREE* 
>>> http://join.msn.com/?page=features/junkmail
>>>
>>> _______________________________________________
>>> Javascript mailing list
>>> Javascript at LaTech.edu
>>> https://lists.LaTech.edu/mailman/listinfo/javascript
>>
>>
>>
>> _______________________________________________
>> Javascript mailing list
>> Javascript at LaTech.edu
>> https://lists.LaTech.edu/mailman/listinfo/javascript
> 
> 
> _________________________________________________________________
> MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. 
> http://join.msn.com/?page=features/virus
> 
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
> 




More information about the Javascript mailing list