Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

javascript alert

Mar 15, 2005 8:45PM PST

Is there a way to create an alert that disappears after a given amount of time?

Discussion is locked

- Collapse -
One that doesn't go away...
Mar 15, 2005 8:53PM PST

Try this in IE and don't say I didn't warn you...

file:javascript:while (true) {alert('this browser window will never see the light of day. mohahahha - Dr.Evil');}

To make your effect, I used GOOGLE and found this -> http://www.informit.com/articles/article.asp?p=30019&seqNum=3&rl=1

Can I ask if you did research on this before posting?

Bob

- Collapse -
restating my question
Mar 15, 2005 11:41PM PST

Try this in IE and don't say I didn't warn you...

file:javascript:while (true) {alert('this browser window will never see the light of day. mohahahha - Dr.Evil');}

******* I'm not a newbie in javascripting.

To make your effect, I used GOOGLE and found this -> http://www.informit.com/articles/article.asp?p=30019&seqNum=3&rl=1

******* setTimeout or setInterval is no good to me here. What I need is an alert that is not modal, and will disappear on its own after a while. The regular alert() will not go away until you click a button on it.

Can I ask if you did research on this before posting?

******* Yes.

- Collapse -
Non modal...
Mar 16, 2005 12:23AM PST

It wouldn't be an alert then... You will have to use something else.

Bob

- Collapse -
window.open
Mar 16, 2005 12:12PM PST

I wanted to mimick a feature in my yahoo messenger where when I get new mail, it alerts me with a something similar to javascript's alert. The popup stays a few seconds, then disappears.

I guess I'll just settle for a simple window.open(), then setTimeout() to run window.close().

Thanks Rob.

- Collapse -
dissappear an alert message after some time
Apr 1, 2005 12:23PM PST

Hi,

I am trying to do the same ' to make dissappear an alert message after some time'
I find that firefox does continue running script so has no problem in running another command but with IE sine it's nonmodal it stops the scripts with an alert.

Is there any solution with IE other than using a timed DIV tag or new browser...