WebBuilder101 - Making the web happen!
Need Web Dev software? Here is the place to
Flash Point
Redirecting Visitors Automatically


Ever wondered how some web sites take you from one page to another without you clicking a single mouse button? If so, you're in for a treat because here is how they do it.

It's called Redirecting and most web builders use it to direct visitors from Splash pages to Home pages, or to direct visitors to pages that have been moved. There are a couple of ways to do this, one way is to use the META Refresh command and another is to use the onLoad event handler.

META Refresh

Place this code between the <HEAD> </HEAD> tags of your document.

<META http-equiv="refresh" content="10; URL=http://yoursite.com/homepage.html">

The content=" " command does two things. It tells the browser how many seconds to wait before executing the refresh, and then what url it should be redirected to.

onLoad

Place this attribute inside the <BODY> tag of your document.

onload=setTimeout("location.href='http://yoursite.com/homepage.html",10000)

The downside to using the META Refresh command is that the time starts counting down when the document starts loading - this is not good especially when your visitors are viewing your web pages with a slow Internet connection. With onLoad, time starts counting down when the page has finished loading.

Also, META Refresh works with seconds (10) and onLoad works with milliseconds (10000) - 10 seconds is equal to 10000 milliseconds.

One last word of advice

Always make sure you include a link to the refresh page in case your site's visitors don't want to wait to get to the other page or in case their browser doesn't recognize your code.

See it in action

.

 

More Resources
Designing Tips
Learn the code
What is HTML?
HTML Editors
Sites designed for specific resolutions
Table size in percents
Dynamic Sites

Suggested Reading

Beginning Active Server Pages 3.0
JavaScript Bible
Red Hat Linux
Dreamweaver 3.0
HTML Bible



Download WB101 Wallpaper
• Web Builder 101 Wallpaper Get it!.
• Find out how to create your own Wallpaper Teach me!.
Sign up for our Newsletters
• Web Building Sign me Up!.
• Net Alert! Sign me Up!.
Need Help?
• Contact Support Click here.
• E-mail the Webmaster Click Here.
• Search Tips Click Here.

Webbuilder101.com © 1998 - 2003 Copyright and Terms of Use
Send mail to: webmaster@webbuilder101.com

» About » Support

» FAQ » What's New » MyLog

Web Builder 101 Web Builder 101 - Making the Web Happen Web Builder 101 - Making the Web Happen
.