Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

use SetTimeout to close popup with frameset

Posted on 2000-04-06
7
Medium Priority
?
408 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 200 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

886 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