Solved

use SetTimeout to close popup with frameset

Posted on 2000-04-06
7
392 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 

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

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

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

Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
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 …
Suggested Courses

631 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