944,014 Members | Top Members by Rank

Ad:
Aug 8th, 2007
0

Frameset and setTimeout

Expand Post »
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()">
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
JC4QLx3 is offline Offline
13 posts
since Jul 2007
Aug 8th, 2007
0

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.
Last edited by ~s.o.s~; Aug 8th, 2007 at 4:47 pm. Reason: Cleaned up a bit.
Super Moderator
Featured Poster
Reputation Points: 3233
Solved Threads: 720
Failure as a human
~s.o.s~ is offline Offline
8,872 posts
since Jun 2006
Aug 9th, 2007
0

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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
JC4QLx3 is offline Offline
13 posts
since Jul 2007
Aug 9th, 2007
0

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.
Last edited by ~s.o.s~; Aug 9th, 2007 at 12:37 pm.
Super Moderator
Featured Poster
Reputation Points: 3233
Solved Threads: 720
Failure as a human
~s.o.s~ is offline Offline
8,872 posts
since Jun 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: Find location of highlighted text
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: Javascript: Child windows talking to each other???





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC