Running a Script from the body onload Event Handler
<html>
<head>
<title>An onload script</title>
<script type="text/javascript"> function done() {
alert("The page has finished loading.");
}
</script>
</head>
<body onload="done()">
Here is some body text.
</body>
</html>