Solved

use SetTimeout to close popup with frameset

Posted on 2000-04-06
7
373 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

707 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