Web Hosting Directory | Web Hosting Resources | Webmaster Resources | Domain Tools | Search Engine Marketing | Forums
  Signup
Today: 895   Yesterday: 1,172   Max: 1,872   Total: 384,276   Current Users : 17 (Member 0) 
DOMAIN TOOLS

WEBMASTER TOOLS

RELATED ARTICLES

SUBMIT AN ARTICLE

Write for us and get publicity, link to your website, and best of all get paid. Please visit our writers page for details.


LINK TO US

Link to us and earn points for each visitor you bring to us. Please visit our link partner page for details.

 

Attribute for <BODY ...>
onLoad = "script command(s)"

Usage Recommendation
use it, but don't rely on it

We've found out that many people are come to this page looking for a variety of techniques. Some of these techniques properly use onLoad, others don't. Here are some of the objectives, and some links to point you in the right direction. After that we'll describe how onLoad works.

Redirecting the Page
If you want the page to automatically forward somewhere else, use <META ...>. See META for Automatic Refreshing and Forwarding.

Popup Window
onLoad cannot be used to control the size or features of the browser window, such as whether or not the window has a status bar or menus. You can control these features when opening new windows. See the Popup Window Tutorial for ready-to-use scripts and examples.

Running Two Commands When The Document is Loaded
See Running Two (or more) Commands With onLoad

Making the Cursor Appear in a Form Field
See Automatically Putting the Cursor in a Field
The browser triggers onLoad when the document is finished loading. The contents of onLoad is one or more JavaScript commands. So, for example, this <BODY ...> tag tells the browser to bring up an alert box once the page is completely loaded:

this code produces this
<BODY onLoad="alert('hello world!')">
this page



Copyright 1997-2002 Idocs, Inc. Written by Miko Sullivan.

 
 
What is your major source of website traffic?
 
 
 
 
 
 

ADVERTISEMENT

 
Cheap Web HostingBudget Web HostingEcommerce Web Hosting
Link to UsLink ExchangeAdvertisePrivacy PolicyTerms Of ServiceAbout UsContact UsSitemap
Copyright © 2006 - 2008 Broadband Media, Inc. All rights reserved.