In Google Chrome, the following code snippet:
<html xmlns = "http://www.w3.org/1999/xhtml">
<head>
<title>Example</title>
<script type = "text/javascript">
<!--
function onBodyLoad()
{
var x = 42;
document.writeln("x = " + x);
alert("on load");
}
-->
</script>
</head>
<body onload = "onBodyLoad()"></body>
</html>
Is not writing
x = 42
to the document. The alert however is displayed. The text and the alert are both displayed in IE8 and FF 3.5. Any thoughts?