大神!为什么我的<body>里面的<img >图片显示不出来呢,难道是下面的js函数问题?
<html xmlns=http://www.w3.org/1999/xhtml>
<head>
<meta charset="utf-8" />
<script type="text/javascript" src="ceshi.js"></script>
</head>
<body>
<img src="aa.jpg" width="200" height="200"/>
<div class="">
<script type="text/javascript">
window.onload = function(){
var html = [];
for (var i = 0; i < yixuan_navs.length; i++) {
var item = yixuan_navs[i];
var child = item.children;
html.push("<div id='" + item.id + "'>" + item.name + "</div>");
html.push("<ul>");
for (var j = 0; j < child.length; j++) {
html.push("<li id='" + child[j].id + "'><a href='" + child[j].url + "'>" + child[j].name + "</a></li>");
}
html.push("</ul>");
}
document.write(html.join(""));
};
</script>
</div>
</body>
</html>
------解决方案--------------------
你把document.write()改成 alert(html.join(""))先试试