By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,466 Members | 1,136 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,466 IT Pros & Developers. It's quick & easy.

Auto Close Dialogue Box & Redirect

P: 3
I'm setting up a system in small museum where a number of web sites will be run locally on a PC with a touchscreen running (I assume) Windows & IE7.

I need every page to have a timed redirect to the homepage, so that when a visitor leaves, everything will reset, ready for the next person. Which I can do OK with Javascript.

I'd like to be able to warn people however, that the redirect is imminent. Some people may take too long to read the page and it will time out on them.

Ideally, I want a dialogue box to pop up that gives the user the opportunity to reset the timer before the redirect happens. This I know is also possible with Javascript and I should be able to do it.

The problem is though, if the visitor has gone, the dialogue box will remain and the redirect will not happen.

I'd ideally like the dialogue box to close automatically after a set time and the page to redirect.

Is this possible? If so, how?

Any help appreciated.

Is it's not possible, I suppose I'll have to make the redirect time long enough so it doesn't time out too soon for anybody and have a big 'Home' button on every page.

Less elegant, but it will obviously work.
Jun 21 '07 #1
Share this Question
Share on Google+
5 Replies


acoder
Expert Mod 15k+
P: 16,027
Welcome to TSDN!

Unfortunately, the dialogue boxes are modal and I don't think this is possible.

What you can do, however, is create your own confirmation dialogue box using DHTML. That would be easy to control using Javascript.
Jun 22 '07 #2

P: 3
Thanks for the welcome. That was pretty much the conclusion I was coming to after some thought.

It would work just as well really.

Would there be a way of triggering the pop-up when the timeout reaches a certain point? EG 10 seconds before the redirect occured?

Would I need to use 2 timeout routines? One to trigger the pop-up and another for the redirect?
Jun 22 '07 #3

acoder
Expert Mod 15k+
P: 16,027
Yes, you could have it as two timeout routines. One possibility is to set the timeout for the redirect in the function which is called in the first timeout
Jun 22 '07 #4

P: 3
Got it working now.

I found I could use the counter to trigger each event at different stages of the countdown. The redirect and a DHTML popup that refreshed the page when a link is clicked and therefore reset the timer and made the popup disappear again.

Thanks for your help.
Jun 27 '07 #5

acoder
Expert Mod 15k+
P: 16,027
No problem. Glad you got it working.
Jun 28 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.