日期:2014-05-16  浏览次数:20282 次

为什么这个例子不能运行
我是在javascript基础教程里面看的例子,
这是脚本
windows.onload=writeMessage;
function writerMessage() {
           document.getElementById("helloMessage").innerHTML="hello,world!";
}
这是html
<!DOCTYPE html>
<html>
<head>
<title>My second script</title>
                  <script src="script2.js"></script>
</head>
<boby>
                        <h1 id="helloMessage">
                           </h1>
</boby>
</html>

保存在同一文件下,脚本是(script2.js),html文件是(带external_script的例子2.html)
为什么不能运行,保存的路径不对吗?求解答新手谢谢

------解决方案--------------------
windows.onload=writeMessage;
function writerMessage() {
------解决方案--------------------
window.onload