Solved

use SetTimeout to close popup with frameset

Posted on 2000-04-06
7
377 Views
Last Modified: 2013-11-19
Anyone know how to get settimeout to self.close a popup that has a frameset?  Code that works for a regular window doesn't work.

I need to make this window close in a certain amount of time - and keep the user from keeping it open.

If i can fix the frameset problem,
i'll probably use a window with no toolbar and block right clicks.

I need to prevent a refresh reset of the timer.

The aim is to allow a user access to the popup window's content for a strict period of time - then forcing it closed.

Thanks
0
Comment
Question by:unending
  • 3
  • 3
7 Comments
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 2689064
setTimeout('top.close()',60000);

Michel
0
 
LVL 19

Accepted Solution

by:
daveamour earned 50 total points
ID: 2689070
Is this any help

<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>

<Script Language="JavaScript">
<!--
  function newWindow()
  {
    x = window.open ("http://localhost/mysite/default.htm","NewWin","Width=400,Height=300");
    ID = window.setTimeout ("x.close();", 10000);
  }
//-->
</Script>

</HEAD>
<BODY>

<P>Click the New window Button</P>
<P>This will open a new window containing a frameset.  The window will then close in 10 seconds</P>
<P><Input Type="Button" Value="New Window" onClick="newWindow();">

</BODY>
</HTML>

Cheers

Dave
0
 

Author Comment

by:unending
ID: 2692032
i tried the basic settimeout approach.
didn't work.
however, the comment by daveamour did solve my problem.
i don't know how to give the points to him though.

thanks dave!
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:unending
ID: 2692035
just noticed how to
"accept comment as answer".
thanks again.
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 2692480
It didn't work how???

I assume you tried

<body onLoad="setTimeout('top.close()',60000); ">
in the popup???

Michel

0
 

Author Comment

by:unending
ID: 2696920
note to mplungjan:

i tried your suggestion.
the code in the popup frameset:

<HTML>
<HEAD>


<TITLE>splash</TITLE>
</HEAD>
 

<FRAMESET COLS="250,*" BORDER="0" FRAMEBORDER="0" FRAMESPACING="0">

<FRAME NAME="search" SRC="menu.asp" SCROLLING=AUTO noresize MARGINWIDTH="0" MARGINHEIGHT="0" ALIGN="TOP">

<FRAME NAME="center" SRC="splash.asp" SCROLLING=AUTO MARGINWIDTH="0" MARGINHEIGHT="0" ALIGN="TOP">
</FRAMESET>

<body onLoad="setTimeout('top.close()',5000);">

</BODY>

</HTML>

_______

the window does not close.
but if i made an obvious coding error,
it wouldn't be the first time!
thanks for your help in any case.
d.
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 2697663
Very obvious.

You cannot have a body tag in a frameset (except in the noframes part and there javascript is ignored)

The body onload belongs in the menu or splash.asp!!!

Michel
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now