[Javascript] parent loose handle to child

Håkan Magnusson hakan at backbase.com
Mon Mar 22 16:39:31 CST 2004


Sorry Dave, the browser has totally discarded the JavaScript space in 
memory from the previous page, so any variables will be lost.

But maybe you could set variables from the child window.

Try this first, I haven't checked it and it is a dirty hack. If it works 
  (with permissions and so on) then I can make the good version later.

parentWindow = window.opener;
parentWindow.location.href=url;
parentWindow.focus();
parentWindow.myWindow = self;
parentWindow.onload = function() { myWindow.focus(); };

Regards,
H

David Lovering wrote:
> Try naming the child window when you create it, and then you can use the DOM
> heirarchy to track to any sttribute within it as needed.
> 
> For example, if the window variable was "myWin" you could change the child
> window URL thusly --
> 
> myWin.location.href = "http://www.yahoo.com";
> 
> 
> ----- Original Message ----- 
> From: "Karl Marklund" <karl.marklund at it.uu.se>
> To: <javascript at LaTech.edu>
> Sent: Sunday, March 21, 2004 9:50 PM
> Subject: [Javascript] parent loose handle to child
> 
> 
> 
>>I realy hope anyone can help me out on this.
>>
>>>From a page I open up a popup. From the popup I do
>>parentWindow = window.opener;
>>parentWindow.location.href=url;
>>parentWindow.focus();
>>
>>to open a new page in the parent window. Is it possible to set back the
>>focus on the popup from this new page in the parent. The problem is that
>>the new page in the parent window doesn't now about the popup anymore...
>>
>>/Karl
>>_______________________________________________
>>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
> 
> 



More information about the Javascript mailing list