I apologize if this question has been asked and answered before. Is
there a way to set a timeout on a window.confirm() call? I want to ask
the user something, but if he doesn't respond within a certain period
of time, I want to treat it the same as if he had clicked Cancel. I
tried using setTimeout() for this, but apparently setTimeout() isn't
checked while a confirm window is open.
|
|
0
|
|
|
|
Reply
|
bill.daly (3)
|
3/6/2007 8:27:05 PM |
|
Pink Pig wrote on 06 mrt 2007 in comp.lang.javascript:
> I apologize if this question has been asked and answered before. Is
> there a way to set a timeout on a window.confirm() call? I want to ask
> the user something, but if he doesn't respond within a certain period
> of time, I want to treat it the same as if he had clicked Cancel. I
> tried using setTimeout() for this, but apparently setTimeout() isn't
> checked while a confirm window is open.
>
>
No.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
|
|
0
|
|
|
|
Reply
|
Evertjan
|
3/6/2007 10:00:10 PM
|
|
In comp.lang.javascript message <1173212825.252169.56560@h3g2000cwc.goog
legroups.com>, Tue, 6 Mar 2007 12:27:05, Pink Pig <bill.daly@tradition-
ny.com> posted:
>I apologize if this question has been asked and answered before. Is
>there a way to set a timeout on a window.confirm() call? I want to ask
>the user something, but if he doesn't respond within a certain period
>of time, I want to treat it the same as if he had clicked Cancel. I
>tried using setTimeout() for this, but apparently setTimeout() isn't
>checked while a confirm window is open.
Does it have to be a confirm()? If you cannot build your own similar
window, you could use yes/no buttons in a small Form, and by program set
the background to be conspicuous during the active interval and disable
or hide the buttons or form outside the interval.
But that would be an undesirable thing to do in a general application,
where the user's attention may be called to another matter at any time.
It's a good idea to read the newsgroup and its FAQ. See below.
--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 IE 6
news:comp.lang.javascript FAQ <URL:http://www.jibbering.com/faq/index.html>.
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
|
|
0
|
|
|
|
Reply
|
Dr
|
3/7/2007 12:15:39 PM
|
|
On Mar 6, 11:00 pm, "Evertjan." <exjxw.hannivo...@interxnl.net> wrote:
> Pink Pig wrote on 06 mrt 2007 in comp.lang.javascript:
>
> > I apologize if this question has been asked and answered before. Is
> > there a way to set a timeout on a window.confirm() call? I want to ask
> > the user something, but if he doesn't respond within a certain period
> > of time, I want to treat it the same as if he had clicked Cancel. I
> > tried using setTimeout() for this, but apparently setTimeout() isn't
> > checked while a confirm window is open.
>
> No.
>
> --
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)
You'll have to simulate confirm() call by making a new window with the
given message and button.
|
|
0
|
|
|
|
Reply
|
Darko
|
3/7/2007 2:47:44 PM
|
|
Darko said the following on 3/7/2007 9:47 AM:
> On Mar 6, 11:00 pm, "Evertjan." <exjxw.hannivo...@interxnl.net> wrote:
>> Pink Pig wrote on 06 mrt 2007 in comp.lang.javascript:
>>
>>> I apologize if this question has been asked and answered before. Is
>>> there a way to set a timeout on a window.confirm() call? I want to ask
>>> the user something, but if he doesn't respond within a certain period
>>> of time, I want to treat it the same as if he had clicked Cancel. I
>>> tried using setTimeout() for this, but apparently setTimeout() isn't
>>> checked while a confirm window is open.
>> No.
>>
> You'll have to simulate confirm() call by making a new window with the
> given message and button.
Are you sure that "have to" is appropriate? You don't have to. You can
always simulate a confirm box with an in page pop-up and not have to
worry about popup blockers blocking the unwanted window.
<URL: http://www.litotes.demon.co.uk/js_info/pop_ups.html>
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
|
|
0
|
|
|
|
Reply
|
Randy
|
3/7/2007 5:28:07 PM
|
|
On Mar 7, 7:15 am, Dr J R Stockton <reply0...@merlyn.demon.co.uk>
wrote:
> Does it have to be a confirm()? If you cannot build your own similar
> window, you could use yes/no buttons in a small Form, and by program set
> the background to be conspicuous during the active interval and disable
> or hide the buttons or form outside the interval.
No, it doesn't have to be a confirm(), but I was hoping to avoid a
heavy-duty learning curve<g>.
> But that would be an undesirable thing to do in a general application,
> where the user's attention may be called to another matter at any time.
Let me explain in more detail. (And keep in mind that I don't have
much experience with this sort of thing.) I'm trying to help my son-in-
law, whose website keeps locking up several times a day. One of my
guesses as to the reason is that a lot of users don't bother to log
out when they are done, they just switch to doing something in another
window or go off to watch TV or something. So I wanted to implement
something that would log them out if they were no longer using the
website, but I wanted to be polite about it. Specifically, after 30
minutes, I want to pop up a window that asks "Do you need more time?",
and if they either say no or don't respond at all, I want to log them
out (quietly). Presumably, if they have either switched to a new
window or left the machine altogether, they won't see this alert, so
they won't respond. I've been looking for ways to do this, but without
luck so far.
> It's a good idea to read the newsgroup and its FAQ. See below.
I went through the FAQ, but didn't find anything that appeared to
address the issue. There are far too many threads here for me to have
read them all. I'll try to catch up, but for all I know the thread
which specifically touches on this is from the 20th century<g>.
Thanks for your attention.
|
|
0
|
|
|
|
Reply
|
Pink
|
3/7/2007 5:36:43 PM
|
|
On Mar 7, 8:47 am, "Darko" <darko.maksimo...@gmail.com> wrote:
> > > but apparently setTimeout() isn't
> > > checked while a confirm window is open.
>
> You'll have to simulate confirm() call by making a new window with the
> given message and button.
if you have to use something different, then a better option is two
floating divs. One that shows the message. 2nd (transparent) that will
hide the background (that will also disable selecting elements and
clicking links).
|
|
0
|
|
|
|
Reply
|
scripts
|
3/7/2007 5:38:16 PM
|
|
> Let me explain in more detail. (And keep in mind that I don't have
> much experience with this sort of thing.) I'm trying to help my son-in-
> law, whose website keeps locking up several times a day. One of my
> guesses as to the reason is that a lot of users don't bother to log
> out when they are done, they just switch to doing something in another
> window or go off to watch TV or something. So I wanted to implement
> something that would log them out if they were no longer using the
> website, but I wanted to be polite about it. Specifically, after 30
> minutes, I want to pop up a window that asks "Do you need more time?",
> and if they either say no or don't respond at all, I want to log them
> out (quietly). Presumably, if they have either switched to a new
> window or left the machine altogether, they won't see this alert, so
> they won't respond. I've been looking for ways to do this, but without
> luck so far.
This isn't the sort of thing you want to do in javascript. Imagine if
a website kept pestering you every x minutes asking if you want to
keep your session alive.
You're probably heading in the wrong direction with the "too many
people not logging out" theory. Http sessions should terminate
automatically after a certain amount of inactivity from the user's
end. The user shouldn't have to explicitly log out for their session
to end.
My first impressions as to what's going on are (these are just
guesses):
-buggy (server-side) code
-server doesn't have enough processing power/memory for what tasks
performed by his website require
-heavy traffic??
I would say look somewhere else for a solution- like server-side web
programming or session programming.
|
|
0
|
|
|
|
Reply
|
Walton
|
3/7/2007 6:45:44 PM
|
|
On Mar 7, 1:45 pm, "Walton" <jrhol...@gmail.com> wrote:
> This isn't the sort of thing you want to do in javascript. Imagine if
> a website kept pestering you every x minutes asking if you want to
> keep your session alive.
I was hoping not to pester anybody, but I thought that others might
have worked out a solution that's livable. Well, maybe not. FWIW, if I
set up a timer with setTimeout(), it doesn't intrude on the user -- he
only sees it when the page it was associated with is visible. I figure
that if I could get it to work at all, then I could tune it to reset
the timer whenever the user does something on the site (like type a
key or move the mouse).
> You're probably heading in the wrong direction with the "too many
> people not logging out" theory. Http sessions should terminate
> automatically after a certain amount of inactivity from the user's
> end. The user shouldn't have to explicitly log out for their session
> to end.
Thanks for the suggestion. I thought I might be barking up the wrong
tree.
> My first impressions as to what's going on are (these are just
> guesses):
> -buggy (server-side) code
This is very possible. The site was originally written by a couple of
guys who had never done a website before. I've tracked down a few
performance issues, but I suspect there's a bug somewhere that's
causing all the trouble. The PHP code gives new meaning to the term
"spaghetti code".
> -server doesn't have enough processing power/memory for what tasks
> performed by his website require
> -heavy traffic??
Less likely. It's not all that big or busy a site, and I'd be very
surprised if the server just can't keep up with the work.
Thanks for the suggestions.
|
|
0
|
|
|
|
Reply
|
Pink
|
3/7/2007 9:42:54 PM
|
|
|
8 Replies
95 Views
(page loaded in 0.511 seconds)
Similiar Articles: telnet timeout - comp.unix.solarisHi, I've a question about timeout in telnet. From the same windows 2000 pc, using command line telnet, I telnet to machine A (IRIX 6.5 IP27), if I le... Semaphore with timeout - comp.unix.programmerTar to another computer follow up: The semaphore timeout period ... Question about these new x64 servers Follow Semaphore with timeout - comp.unix.programmer Question ... TCP connect timeout setting in Solaris - comp.sys.sun.admin ...Solaris Operating System: TCP connect timeout setting in Solaris ... software.itags.org: Solaris Operating System question: TCP connect timeout setting in Solaris, created ... timeout on tcp/ip read? - comp.unix.programmer-- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in ... that if I call read and no data is > available after 60 seconds > that a timeout ... TIMEOUT=900: is not an identifier - comp.unix.solaris... Post Question | Groups | ... But setting a variable TIMEOUT to charcaters string "900" should not leads to the ... ssh question: KeepAlive setting? - comp.unix.shellHow to set HTTP connect timeout - comp.lang.javascript ssh question: KeepAlive setting? - comp.unix.shell How to set HTTP connect timeout - comp.lang.javascript ssh ... TCP timeout on Solaris 9? - comp.unix.solarisWhat I think is happening... the PIX has a TCP timeout value of 1 hour, the Solaris ... I initially kept this question simple so I left out the fact that we had another ... error: timeout waiting for ARP/RARP packet - comp.unix.solaris ...... Post Question | Groups | ... solaris 9.0 on a Sun ultra box >> through the cd disk.I am geting an error 'timeout ... OpenBoot Prom / 'go' Question - comp.unix.solarisYou need to boot from cdrom (boot cdrom) from the OpenBoot Prom also change your ... OpenBoot Prom / 'go' Question - comp.unix.solaris ... error: timeout waiting for ARP ... How to detect idle user for timeout logoff - comp.lang.java ...... Post Question | Groups | ... Cisco Systems The Cisco VPN Client does not work ... disable timeout and allow an ... readLine() timeout question: java, socketHi, I made a server application in Java and a client application in PHP. the server waits for the client's message like below String message=reader ... Re: Timeout question - AppleIs the problem a browser timeout (ie, not response from the server in 60 seconds) or is PayPal saying the customer is taking too long to complete the transaction? 7/26/2012 2:28:15 AM
|