Web Teacher Software
web database
Javacript 
Tutorial
CGI tutorial
web 
database consulting
web database training
contact us about web 
database software
press
Hosted Database Solutions
webteacher home
Web Teacher Consulting

javascript tutorial graphic


Take this course LIVE in Southern California
Rob Young will be leading 'JavaScript for the Total Non-Programmer' at Irvine Valley College this September. The class is offered in 2 sections:

1. Tue (9/23) and Thu (9/25) 6p-9p
2. Saturday (9/25) 9a-4p

Click here to register

The SetTimeout() Method

This one is easy! You can make and JavaScript command execute after a delay by typing the command like this:

setTimeout(" your function ", delay in milliseconds)

So for example, this function would make an alert box appear 5 seconds after you click the button.

function MsgBox() {
alert("Hello There");
}
<FORM>
<INPUT type=button value="try it"
onClick="setTimeout('MsgBox()',5000)">
</Form>

So, when I made my welcome window a few pages ago, I simply had to use this function in the <BODY onLoad=" "> statement.

function Welcome() {
NewWindow = window.open("welcome.html","","width=200,height=200");
SetTimeout("NewWindow.close()",5000);
}

Bonus Chapter! Special Effects.

Home | WebData - Web Database Software | Javascript | CGI | Consulting | Map Builder | Contact Us | The Press Room