can anybody please help. 
Author Message
 can anybody please help.

I have a window which contains 3 frames. From the web page in the contant
frame I open a another window with window.open command. I would like the
close this new window when webpage in the content frame unloads.

Can anybody please give me any suggestions.

Thanks
hadi



Tue, 07 Sep 2004 21:31:18 GMT  
 can anybody please help.
You can use the onUnload attribute. This attribute is supported by the BODY
and FRAMESET tags. I haven't used them yet, but I hope this helps.

I don't think you can close a window btw. You can call the close function,
but the user will be asked for verification.

Hans


Quote:
> I have a window which contains 3 frames. From the web page in the contant
> frame I open a another window with window.open command. I would like the
> close this new window when webpage in the content frame unloads.

> Can anybody please give me any suggestions.

> Thanks
> hadi



Tue, 07 Sep 2004 22:35:11 GMT  
 can anybody please help.


Quote:
> I have a window which contains 3 frames. From the web page in the contant
> frame I open a another window with window.open command. I would like the
> close this new window when webpage in the content frame unloads.

> Can anybody please give me any suggestions.

> Thanks
> hadi

Hadi,

When you open the window, keep a reference to the new window object and use
it to close the window when the unload event is triggered:

<script>
var childWin;
var winOpen=false;

function openWindow(winURL, winName, winAttribs) {
    if (winOpen) {
        if(!childWin.closed) {
            childWin.close();
        }
    }
    childWin=window.open(winURL, winName, winAttribs);
    winOpen=true;

Quote:
}

function closeWindow() {
    if (winOpen) {
        if(!childWin.closed) {
            childWin.close();
        }
    }
Quote:
}

</script>

Just attach the closeWindow() function to whatever unload event is
appropriate and hopefully that'll do the trick.

Hope this works for you,

Tony.



Tue, 07 Sep 2004 23:36:19 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Can anybody help with a script, please?

2. anybody Know about Layers in JScript ( Please Help Me )

3. PLEASE HELP PLEASE HELP PLEASE HELP

4. PLEASE PLEASE PLEASE HELP!!!!

5. Help, please please please!!!! Inputing a Hexadecimal Number

6. Can anybody help???

7. Take screenshot from IE Window - can anybody help

8. Would anybody can for gracefulness to help me???

9. Can anybody help???

10. please please help, Epson stylus Color IIs trouble

11. Please Please Can U Help With RIPSLOAD Software

12. Please, please help me keep my job!!

 

 
Powered by phpBB® Forum Software