DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   JavaScript / DHTML / AJAX (http://www.daniweb.com/forums/forum117.html)
-   -   Frameset and setTimeout (http://www.daniweb.com/forums/thread85704.html)

JC4QLx3 Aug 8th, 2007 4:11 pm
Frameset and setTimeout
 
The following code worked perfectly when I was using a normal window, but now that I have changed it to a frameset, it does not work. I have been reading as much as I can find on the subject and I realize that there are a different set of rules with "parent" etc. Please advise.



<SCRIPT language="JavaScript">
        <!--
        // reset timer
        var timer = window.setTimeout('closeWindow()',1800000);
       
        function resetTimer()
        {
        window.opener.resetTimer();
        window.clearTimeout(timer);
        timer = window.setTimeout('closeWindow()',1800000);
        }
       
        function closeWindow()
        {
        window.close();
        }
        //-->
</SCRIPT>

<BODY onFocus="resetTimer()">

~s.o.s~ Aug 8th, 2007 4:35 pm
Re: Frameset and setTimeout
 
Use top.your_frame_name or window.frames['your_frame_name'] to get the frame reference.(here top is the global window object).

Read this for more information about DOM.

JC4QLx3 Aug 9th, 2007 12:08 am
Re: Frameset and setTimeout
 
Here is my problem and it may be that you are talking over my head. I want to close the frameset window. It is not a frame.

~s.o.s~ Aug 9th, 2007 12:34 pm
Re: Frameset and setTimeout
 
> I want to close the frameset window. It is not a frame.
Do you know what you are saying? Frames are defined in the frameset tag and without frame tags, frameset is of no use. So how is that "its not a frame"?

Paste the working example and maybe then it would be easier for us to render help.


All times are GMT -4. The time now is 6:07 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC