[Javascript] A Temporary Alert?
tedd
tedd.sperling at gmail.com
Sun Dec 23 20:22:31 CST 2007
At 6:58 AM -0700 12/23/07, David Lovering wrote:
>This is hardly the most elegant solution, but it works on most browser
>platforms I've dealt with.
>
>In the HTML body declaration of your dialog, create an 'onload' event
>handler of the following sort:
>
>onload = "setTimeout( 'window.this.close()', 5000)";
>
>This is dirt simple, and no doubt will call down the wrath of the Javascript
>gurus with much more refined (and less fragile) solutions.
>
>While you can reference an alert as a window and play the same games, it is
>often hard (and somewhat browser dependent) to do so; I prefer to create a
>child window and use it instead of a generic alert. With a little
>imagination, you can manipulate the window parameters so that the user is
>completely unaware that he is not talking directly to an alert - but you
>have the window id and name under your full control. It also is less
>complicated to reference the <body> portion of the code in order to insert
>the onload handler.
>
>-- Dave Lovering
Thanks Dave -- I'll look into that.
It really doesn't have to be an Alert -- it could be a window.
You see, I have a database access that can take up to five seconds
after the user clicks "Submit" and during that time I would like to
tell the user to wait (instead of clicking things widely and throwing
a tantrum) -- which is what I do when I don't know what's happening.
I'm actually surprised that such a critter isn't a staple for
programming GUI stuff.
Cheers,
tedd
>
>
>
>
>----- Original Message -----
>From: "tedd" <tedd at sperling.com>
>To: "JavaScript List" <javascript at lists.evolt.org>
>Sent: Saturday, December 22, 2007 3:33 PM
>Subject: [Javascript] A Temporary Alert?
>
>
>> Hi gang:
>>
>> I've looked, but can not find a temporary Alert.
>>
>> What I mean is:
>>
>> "Hi, this is a temporary Alert box and I will automatically close in
>> 5 seconds."
>>
>> An Alert that will notify the user of something, but will NOT require
>> the user to respond to go away. But instead, will close on its own
>> after a set time.
>>
>> It sounds simple enough, but I couldn't find nor generate one. Can
>> this be done?
>>
>> Thanks in advance for any references or code.
>>
>> Cheers,
>>
>> tedd
>>
>> --
>> -------
>> http://sperling.com http://ancientstones.com http://earthstones.com
>> _______________________________________________
>> Javascript mailing list
>> Javascript at lists.evolt.org
>> http://lists.evolt.org/mailman/listinfo/javascript
>>
>
>
>_______________________________________________
>Javascript mailing list
>Javascript at lists.evolt.org
>http://lists.evolt.org/mailman/listinfo/javascript
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
More information about the Javascript
mailing list