compare the following working code to yours ... have a look at the doctype definition and the typo in your script-source
[HTML]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>second script</title>
<script language="Javascript" type="text/javascript" src="script.js"></script>
</head>
<body bgcolor="#FFFFFF">
<h1 id="helloMessage"></h1>
</body>
</html>[/HTML]
-
// JavaScript Document
-
window.onload = writeMessage;
-
-
// you had a typo here!
-
function writeMessage() {
-
document.getElementById("helloMessage").innerHTML = "Hello, world";
-
}
... if you are starting to use javascript i would recommend to test your code with firefox and the firebug-extension ... gives you really good hints on errors you make ... for example it would say that method writeMessage is not defined with your code ... until you wrote writerMessage ... and thats a hint for you to have a look why :) ... so you may find such things real fast ...
kind regards ...