Closing Child window from parent window

G

gokul

Hi all,
Iam using mozilla firebird.
I have three popups displayed at one point of time...if I close one
the other two goes hidden....could you please suggest me the reason
for this behaviour and how to overcome it.....

While I opened......these child windows(popup)...from the main window
I have given "dependent=yes" in the window.open statement.

The sameway I want to close the Child windows opened from the parent
window using IE. I use IE 6.0.

All your suggestions are welcome.
TIA.
Regards
Gokul
 
L

lallous

How are you creating these windows?
win1 = window.open(...)
win2 = window.open(...)
win3 = window.open(...)

Then you close say one as: win2.close() ?

Don't know about the 'dependent' flag, try removing and see too.

Regards,
Elias
 
G

gokul

Dear Lallous,
Thank you for the Suggestion.But Iam unable to get the job done.
because its unable to find the object.
This is how I use the method in my parent window to create popup.
<a href="#" onclick="javascript:popup('http:\\localhost')">Open
Window</a>
as shown above from 2 to 3 pages I open these popups....
I use a js file by name popup.js which has the code:
function popup(sUrl)
{
popWin= window.open(sUrl, 'taxp_WFaq',
'dependent=yes,height=340,width=550,left=160,top=130, scrollbars=yes,
resizable=yes');
popWin.unload="javascript:WinMaximize()";
popWin.focus();
childVal = popWin ;
return;
}

The above is the exact scenario.

TIA,
Gokul Raja Dhamodaran.
 
G

Grant Wagner

gokul said:
Dear Lallous,
Thank you for the Suggestion.But Iam unable to get the job done.
because its unable to find the object.
This is how I use the method in my parent window to create popup.
<a href="#" onclick="javascript:popup('http:\\localhost')">Open

javascript: is not required here, and you should probably be returning false to the event handler to
ensure the HREF is not followed:

Window</a>
as shown above from 2 to 3 pages I open these popups....
I use a js file by name popup.js which has the code:
function popup(sUrl)
{
popWin= window.open(sUrl, 'taxp_WFaq',
'dependent=yes,height=340,width=550,left=160,top=130, scrollbars=yes,
resizable=yes');
popWin.unload="javascript:WinMaximize()";

This is not how you dynamically set an event, and even if it were, there is no "unload" event associated
with the window object. Perhaps what you are trying to do is:

popWin.onunload = function() { WinMaximize(); }

Of course, WinMaximize() has to be defined on the page you are opening, or this will not work. If
WinMaximize() is defined on the page you are opening *from*, then:

popWin.onunload = function() { if (opener && opener.WinMaximize) WinMaximize(); }

may work. Untested.
popWin.focus();
childVal = popWin ;
return;

return is unnecessary here, the function will return on it's own.
}

The above is the exact scenario.

TIA,
Gokul Raja Dhamodaran.

--
| Grant Wagner <[email protected]>

* Client-side Javascript and Netscape 4 DOM Reference available at:
* http://devedge.netscape.com/library/manuals/2000/javascript/1.3/reference/frames.html
* Internet Explorer DOM Reference available at:
* http://msdn.microsoft.com/workshop/author/dhtml/reference/dhtml_reference_entry.asp
* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
* http://www.mozilla.org/docs/web-developer/upgrade_2.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top