Frameset and setTimeout

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Jul 2007
Posts: 13
Reputation: JC4QLx3 is an unknown quantity at this point 
Solved Threads: 0
JC4QLx3 JC4QLx3 is offline Offline
Newbie Poster

Frameset and setTimeout

 
0
  #1
Aug 8th, 2007
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.


JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1.  
  2. <SCRIPT language="JavaScript">
  3. <!--
  4. // reset timer
  5. var timer = window.setTimeout('closeWindow()',1800000);
  6.  
  7. function resetTimer()
  8. {
  9. window.opener.resetTimer();
  10. window.clearTimeout(timer);
  11. timer = window.setTimeout('closeWindow()',1800000);
  12. }
  13.  
  14. function closeWindow()
  15. {
  16. window.close();
  17. }
  18. //-->
  19. </SCRIPT>
  20.  
  21. <BODY onFocus="resetTimer()">
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 7,582
Reputation: ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of 
Solved Threads: 461
Super Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Failure as a human

Re: Frameset and setTimeout

 
0
  #2
Aug 8th, 2007
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.
Last edited by ~s.o.s~; Aug 8th, 2007 at 4:47 pm. Reason: Cleaned up a bit.
I don't accept change; I don't deserve to live.
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 13
Reputation: JC4QLx3 is an unknown quantity at this point 
Solved Threads: 0
JC4QLx3 JC4QLx3 is offline Offline
Newbie Poster

Re: Frameset and setTimeout

 
0
  #3
Aug 9th, 2007
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.
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 7,582
Reputation: ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of 
Solved Threads: 461
Super Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Failure as a human

Re: Frameset and setTimeout

 
0
  #4
Aug 9th, 2007
> 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.
Last edited by ~s.o.s~; Aug 9th, 2007 at 12:37 pm.
I don't accept change; I don't deserve to live.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC