Webmaster Cash Program
 Upload & Sell Your Software
Upload & Sell Your Ebook
 Enter The AWT Service Center  Contact Applied Web Tools
 Purchase Some Advertising  Password Troubles? Click Here!
Knowledge Center
Want to write for Applied Web Tools? Send your Writer's Query to
Editor@AppliedWebTools.net for details.
HTML
Reference
&
Tutorial
CSS
Reference
&
Tutorial
DOM
Reference
&
Tutorial
JavaScript
Reference
&
Tutorial
50+ Programming Examples
Use HTML, CSS, DOM & JavaScript Together
Misc. Essays & Documents
You'll Find Just About Anything In Here
50+ Web Page Constructions
Learn the Art of Using HTML, CSS, DOM & JavaScript Together
 Changing Background Colors
 Event Triggering With onLoad
 Disabling The Right Click
 DOM Driven Color Changing
 Switching Images
 innerHTML Attribute Access
 Change With innerHTML
 Changing Positions
 Change Position With onMouseMove
 Change Text Position
 Interactivity Skills
 Type-writing A Message
 Auto-changing Text Size
 Making Text Scroll
 Blinking Text
 Simple Form Authentication
 Change Background Color Of An INPUT
 Change Text Color Of An INPUT
 Change Background Image Of An INPUT
 Select All Checkboxes
 Select Color Of The Submit Button
 Change Text Color Of A Submit Button
 Insert Background Image To A Button
 Change Color Of Drop Down List
 Change Text Color Of A Drop Down List
 Change Color Of A TEXTAREA
 Change The Text Color Of A TEXTAREA
 Insert An Image Into A TEXTAREA
 Change The Size Of An Image
 Change The Source Of An Image
 Change The Position Of An Image
 Change The Background Image
 Moving Images Around The Page
 Drag & Drop An Image
 A Simple Image Viewer
 A Shaking Image
 A Digital Clock
 Drop Down List Link
 Top Drop Down Menu
 Always On Top Menu
 Inset Border Buttons
 A Description Generating Menu
 An Image Generating Menu
 A Horizontal Sliding Menu
 A Click Horizontal Sliding Menu
 Returning Cursor Co-ordinates
 Making Text Follow The Cursor
 Attaching An Image To The Cursor
onLoad Event Trigger

Learning to use an onLoad event handler is great. Through the use of this simple event handler, you can time actions to coincide with subtle things such as starting an action when the page element is finished loading and is displayed. Applying a CSS rule when a large image is finished downloading, for example.

Try downloading a large file such as an audio or video file. Change the border property of a table to 1 with a bgcolor=”red” statement and a border will be displayed around the object that is 1 pixel wide, colored red, when the file is finished loading into the page. Put the instructions in a script in the head of the document and state the JavaScript function within the body of the document as that to be processed when the onLoad event is triggered.

The example below uses the onLoad event in the BODY tag to display an alert box with the text given when the entire document is finished loading. You don’t have to apply this rule in terms of document wide alterations – the onLoad event can be triggered in any HTML tag and applied when the tag is finished loading by the browser.

<html>
<head>
<script type="text/javascript">
function mymessage()
{
alert("This message was triggered from the onload event");
}
</script>
</head>

<body onload="mymessage()">

</body>
</html>


You can accomplish quite a bit of creative actions using this simple event. Try mixing this event with its opposite, the onUnload event handler. onUnload is very handy to write user preferences or any generated data to a cookie when the page is closed, I’ve found. You can then use the data contained within the cookie and apply it to the next page by applying it using the onLoad function in the next page.
Want a copy of the Applied Web Tools Knowledge Center on your site?

Over 1200 individual command definitions in a really cool interface

Send your query to Sales@AppliedWebTools.net for details
I do not employ cookies or tracking devices of any kind