W3C home > Mailing lists > Public > www-html@w3.org > June 2000

the onload event

From: Lars <Lars_Reith@bigfoot.de>
Date: Sat, 5 Feb 2000 22:03:32 +0100
Message-ID: <003701bf701c$75835640$0400a8c0@lars>
To: <www-html@w3.org>
<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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:15:43 GMT