Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Child windows can not access window.opener when multiple child windows are open

Reply
Thread Tools

Child windows can not access window.opener when multiple child windows are open

 
 
ian.michel@gmail.com
Guest
Posts: n/a
 
      12-14-2004
I have a parent window that pushes a new window object onto an Array
with the following code :

OpenChild()
{

//totalNumWindowsCreated is global

totalNumWindowsCreated = totalNumWindowsCreated + 1;
childWnds.push(window.open(link, "child" +
totalNumWindowsCreated,"dependent"));

..
..
..
}

This pops up a new window with every call. In the child window I call
a parent function onbeforeunload, appClose() :

function appClose(){

if (window.opener && !window.opener.closed){
window.opener.CloseChild(getQueryString("applicati on"));
}
}

This is in my frameset tag of the child code :

<frameset ... onbeforeUnload='appClose()'>

The window.opener.CloseChild() function is called perfectly when I have
one child window open, but as soon as I create another child window
both of the open child windows don't ever call it. They do both go
into the onbeforeunload appClose() function, but do not call the
window.opener.CloseChild() function inside of this routine.

Anyone have any ideas why when I have two child windows open I can't
access the window.opener functions?

I have tried taking each new window out of the array and used the
following code in CloseChild() :

CloseChild()
{

//win and totalNumWindowsCreated are both global

totalNumWindowsCreated = totalNumWindowsCreated + 1;
var win = window.open(link, "child" +
totalNumWindowsCreated,"dependent");

..
..
..
}

All to no avail...

Thanks for the help in advance,

Ian Michel

 
Reply With Quote
 
 
 
 
Ivo
Guest
Posts: n/a
 
      12-14-2004
<(E-Mail Removed)> wrote
> Anyone have any ideas why when I have two child windows open I can't
> access the window.opener functions?


Sorry, no idea. what does alert(window.opener) tell you ?

> I have tried taking each new window out of the array and used the
> following code in CloseChild() :
>
> CloseChild()
> {
> //win and totalNumWindowsCreated are both global
>
> totalNumWindowsCreated = totalNumWindowsCreated + 1;
> var win = window.open(link, "child" +
> totalNumWindowsCreated,"dependent");


Because of the "var" keyword the variable win looks awefully local to me.
Not sure how it relates to the described problem tho .

--
Ivo



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
pexpect on windows - child process of another child process - quickquestion Z W Python 0 03-09-2013 10:00 PM
Boa: howto make child windows really child bvidinli Python 0 04-15-2008 08:58 AM
HELP! Child controls of child controls not visible to web app lisa@starways.net ASP .Net Building Controls 0 05-05-2005 09:14 PM
Parent/Child relations - Trying to access child control for save tnt_lu@hotmail.com ASP .Net Datagrid Control 0 04-15-2005 12:50 PM
How do I: Main thread spawn child threads, which child processes...control those child processes? Jeff Rodriguez C Programming 23 12-09-2003 11:06 PM



Advertisments