VBscript question on displaying a timed message

How do I create a message box or a display that will close by itself in a certain number of seconds

Basically I want a box to pop up when a user logs on and then automatically dissappear after a specified amount of time.
rfedeleoAsked:
Who is Participating?
 
peh803Commented:
here's a 2 page example (just copy and paste the code into the two pages default.html and pop2.html as specified).

regards,
peh803

<!-- BEGIN Page 1 -- default.html-->
<script type="text/javascript">
function MyOnload(){
  window.open('pop2.html');
}  
</script>
<BODY onload="MyOnload();">
  This is default.html.  When this page loads, pop2.html will popup and then close after 5 seconds.
</BODY>
<!-- END Page 1 -- default.html-->


<!-- BEGIN Page 2 -- pop2.html -->
<script type="text/javascript">
var timer = 5;
function TimedCloser()
{
  if(timer > 0)
  {
    document.getElementById('seconds').innerHTML = timer;
    timer -= 1;
    setTimeout("TimedCloser()",1000);
  }
  else
  {
    window.close(this);
  }
}

</script>
<BODY onload="TimedCloser(5);">
  Here's pop2.html.  This window will close in <span id=seconds>5</span> seconds.
</BODY>
<!-- CLOSE Page 2 -- pop2.html -->
0
 
mistyraeCommented:
In the body element of your pop-up window, call setTimeout in the onLoad attribute... Like this:

<body onLoad="setTimeout('window.close()', 5000)">

That example will close the window in 5 seconds (setTimeout uses milliseconds as its time argument)

- misty
0
 
peh803Commented:
@rfedeleo -- considering I gave you a fully functional example, why did you give me a grade of a "C"?  Obviously, I'll steer clear of helping out on your questions in the future, as will other experts who see this grade (particularly when you've provided no explanation as to why the low grade).  

If you still have problems, you should post questions seeking clarification, etc.  But to give a "C" with no explanation is a slap in the face to those who donate their time to help you out.

peh803
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
rfedeleoAuthor Commented:
I seriously doubt anyone else will "steer clear" of my questions. I pay my 9.95 a month just like everyone else who pays and I give my points away to people who answer the questions so they get the  free benefits of this site. So I'll give any kind of grade I please. And if you want a reason it's because I did not use your solution for what I was working on and just wanted to close the Question out. The only reason I picked yours was because it had a little more effort than the other persons. Therefore I did not even test your solution! But bottom line is you got the points, and I chose "average" as the response (how am I supposed to know that they give you a letter grade, what is this high school) and give me a break with your "slap in the face" comment do you think you're the only person writing these things...what about people on the microsoft self help forums that do this stuff and don't get anything back, no grades, no free benefits, no points. So you stick with your C grade and get an A+ for whining.
0
 
peh803Commented:
My point here was not to be a whiner -- just that when someone gives a C, it's typically because

  a.) the solution provided did not work
  b.) no solution was provided
  c.) they worked long and hard to come to a solution, and no one could come up with anything

But at least you should post some kind of response as to why the lowest grade is being given -- something which you did not do until just now, when it is too late.  
0
 
peh803Commented:
The only history we share is shown here in this question.  I never meant to make it a big deal...I just thought I deserved some kind of explanation as to why a C was given.

peh803
0
 
rfedeleoAuthor Commented:
Fritz
I wasn't trying to be ungrateful. I was just a little shocked that someone would complain about the grade they got. If that's the case why even put the grading system in. Just give them the points. Another thing is I did not know about the grades, all I saw were the choices of Excellent, some other choice, and average so I chose average (and explained why above). No where did it indicate what the equivalent letter grades were.

 I did nothing wrong by giving my points and an "average" grade. That said had I known letter grades were given out I probably would have not given a C.

Now, to be told that I probably would not have any other experts answer any future questions or that a C grade was a slap in the face, was a shock to me and that's what brought on my response.
0
 
fritz_the_blankCommented:
@rfedeleo:

Thanks for writing. For details on grading, please see:

http://www.experts-exchange.com/Web/Web_Languages/ASP/help.jsp#hi73

If you would like me to change the grade, please let me know.

Fritz the Blank
Page Editor
ASP Topic Area
0
 
rfedeleoAuthor Commented:
What the heck... go ahead and change it to a B, and thanks for the link.
0
 
peh803Commented:
rfedeleo --
Thanks, I do appreciate it.

Also, if there's any way you could modify / remove the feedback that you left on my profile, I would appreciate it.  

Thanks in advance,
peh803
0
 
peh803Commented:
Also, ty FtB, for your help with this situation.

peh803
0
 
rfedeleoAuthor Commented:
Fritz,
   Could you remove the feedback I left, or point me to how I can do it.

Thanks
0
 
fritz_the_blankCommented:
You should be able to modify it by going here:

http://www.experts-exchange.com/viewMemberFeedback.jsp?mid=1322706

If not, please let me know and I will have a moderator remove the feedback.

Thank you!

FtB
0
 
peh803Commented:
@rfedeleo:

Any luck on removing that feedback?  As yet, it doesn't appear so, as it's still there.

Please let me / FtB know if you need any more guidance / help in removing it.

Thanks,
peh803
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.