Javascript forwarding
For quite a while now, people have been using the META REFRESH tag to forward surfers to another page. Usually this is in conjunction with some kind of splash page, designed to introduce and build anticipation for a site. You probably saw the PixelPusher.com splash page as you entered this site. The biggest problem with META REFRESH, however, was in guestimating how long to make the delay before forwarding the surfer to the next page. Since the clock started ticking when the page first started loading, you could never be sure if the page had fully loaded before the surfer was whisked away. Setting the delay for 10 or 15 seconds bores the pants off users with faster connections, and they go read The Onion instead. What to do??
Javascript to the rescue! This short tidbit of code, called an onload command, can be placed inside a variety of tags, but for our purposes, we'll put it in the <BODY tag. That way, the entire body of the html page has to finish loading before the countdown begins.
Here's the code to put in your <BODY tag: onload=setTimeout("location.href='main.html'",5000)
Note that the META REFRESH tag counts time in seconds, while the javascript command counts in milliseconds, so 5000 is 5 seconds.
You'll also want to put an old-fashioned META REFRESH in the <HEAD> of your page, inside <NOSCRIPT> tags. That way, non-javascript browsers will be able to us the META REFRESH function, and still arrive at the next page. Remember to make this delay a little longer, to compensate for the time it will take to load the page.
So, the whole thing should look something like this:
<HEAD>
<NOSCRIPT>
<META HTTP-EQUIV="Refresh" CONTENT="10; URL=main.html">
</NOSCRIPT>
</HEAD>
<BODY onload=setTimeout("location.href='main.html'",5000)>