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

关于window.onload无法执行的问题, 求助大神
我网站编程基本不大会。
现在用dreamweaver编了一个网站的架构 然后想把之前编的javascript程序添加进去, 但是再打开网页的时候就不能运行那个javascript了。 单独的时候是可以运行的。 请大神们帮忙给看看 谢谢了 下面是我的代码


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- DW6 -->
<head>
<!-- Copyright 2005 Macromedia, Inc. All rights reserved. -->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>F-Droid</title>
<link rel="stylesheet" href="2col_leftNav.css" type="text/css" />
<style type="text/css">
<!--
.STYLE1 {font-size: xx-large}
-->
</style>
<SCRIPT>
var xmlDoc = new ActiveXObject("microsoft.xmldom")
xmlDoc.async=false
xmlDoc.load("fdroid.xml")
root=xmlDoc.documentElement
newHTML=""
function start(){
buildTree(root)
content.innerHTML=newHTML
}
function buildTree(passedNode){
var children = passedNode.childNodes.length
for (var j=0; j<children; j++){
Node=passedNode.childNodes.item(j)
if (Node.nodeName=="application"){ newHTML+=("<div class="story"><P>"+Node.nodeName+" "+j) }
if (!Node.hasChildNodes()){
if(Node.parentNode.nodeName == "name"){
newHTML+=( "<BR><B>"+Node.parentNode.nodeName+":</B> "+Node.text )}
else if (Node.parentNode.nodeName =="icon"){
newHTML+=("<BR><img src=\icons\" +Node.text +"></div>" )}
}
buildTree(Node)
}
}
window.onload = start;
</SCRIPT>

</head>

<BODY>
<!-- The structure of this file is exactly the same as 2col_rightNav.html;
  the only difference between the two is the stylesheet they use -->

<div id="masthead">
  <h1 id="siteName">F-Droid</h1>
</div>
<!-- end masthead -->
<div id="content">
  <h2 id="pageName">HomePage</h2>
  <div class="feature"> <img src="file:///C|/Users/lenovo/Documents/T-Droid/cropped-fdroidheader.jpg" alt="" width="331" height="112" />
  <h3>F-droid</h3>
  <p>. find the application you want!!! </p>
  </div>
  <div class="story"></div>
</div>
<!--end content -->
<div id="navBar">
  <div id="search">
  <form action="#">
  <label>search</label>
  <input name="searchFor" type="text" size="10" />
  <input name="goButton" type="submit" value="go" />
  </form>
  </div>
  <div id="sectionLinks">
  <ul>
  <li><a href="#" class="STYLE1">首页</a></li>
  <li><span class="STYLE1"><a href="#">热门</a></span></li>
  <li><span class="STYLE1"><a href="#">趋势</a></span></li>
  </ul>
  </div>
  <div class="relatedLinks">
  <h3>分类</h3>
  <ul>
  <li><a href="#&