the onload event

<html>
<head>
 <title>Untitled</title>
<script>var information</script>
<script>
function init()
{information="Hello there"}
</script>
</head>

<body onload="init()">
<script>
document.writeln(information)
</script>


</body>
</html>

This time, I defined the variable in the very beginning of the document. This seems to work since no error accurs. However, the value of the variable remains "undefined", that text will show up on the screen when the body is executed. This leads to the conclusion that the onload trigger is not activating the init() function. Is this a problem of the onload trigger event?

Received on Saturday, 17 June 2000 21:04:01 UTC