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 & onUnload

The load event handlers are great to work with. There are many different ways you can use them, and all are very useful and easy to implement. The two JavaScript function used in the example are fairly basic, although the first function, starttimer(), uses four DOM statements and two JavaScript object activations.

<html>
<head>

<script type="text/javascript">
var i=1
function starttimer() {
document.getElementById('h_one').style.position="relative";
document.getElementById('h_one').style.left=+i;
document.getElementById('h_two').style.position="relative";
document.getElementById('h_two').style.top=+i;
i++;
timer=setTimeout("starttimer()",10);
}

function stoptimer() {
clearTimeout(timer);
}
</script>

</head>

<body onLoad="starttimer()" onUnload="stoptimer()">

<h1 id="h_one">Header one</h1>
<h1 id="h_two">Header two</h1>

</body>
</html>


The JavaScript functions we’ve stated are relatively positioned. The value of this relatively positioned porton of the document is given in the I variable. Note that the increment operand (+) is used with the variable name. This increments the numeric value within the variable by one, changing the position of said page element.

It is extremely handy to be able to carry data from one page to the next without first sending that data to the web server to be stored, processed, and re-served for the next page. Using the onUnload event handler, you are able to attach a series of nested commands that allow you to store data such as user preferences in a cookie on the user machine and load from that cookie to format the next page on the fly through the use of the onLoad event handler.
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