首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

window.onload=count;没反应,该怎么处理

2012-09-10 
window.onloadcount没反应function showPic(whichpic){var sourcewhichpic.getAttribute(href)var p

window.onload=count;没反应
function showPic(whichpic){
var source=whichpic.getAttribute("href");  
var placeholder=document.getElementById("placeholder"); 
placeholder.setAttribute("src",source);
}
function count()
{
var body=document.getElementByTagName("body")[0];
alert(body.childNodes.length);
alert("hi");
}
window.onload=count;用ie9,firefox。safari都不行,代码错了吗??



[解决办法]
document.getElementsByTagName("body")[0]啦

热点排行
Bad Request.