关于addLoadEvent这个函数的问题,求解!


showPic函数代码
生成的网页

点击缩略图总是打开了一个新网页,怎样才可以替换当前页面下面那张图?好急哦。该如何调用?

发代码出来,这样看得头晕,大概看了下代码应该没问题,除了描述那个if(!去掉!。。

自己检查下js路径是否正确

function showPic(whichpic){
if (!document.getElementById("placeholder")) return true;
var source = whichpic.getAttribute("href");
var placeholder = document.getElementById("placeholder");

    placeholder.setAttribute("src",source);
    if(!docuement.getElementById("description")) return false;
    if (whichpic.getAttribute("title")) {
    var text = whichpic.getAttribute("title");
    } else {
    var text = "";
    }
        var description = document.getElementById("description");
        if(description.firstChild.nodeType==3){
            description.firstChild.nodeValue=text;
    }

    return false;   
}
/*function showPic(whichpic) {

if (!document.getElementById("placeholder")) return true;
var source = whichpic.getAttribute("href");
var placeholder = document.getElementById("placeholder");
placeholder.setAttribute("src",source);
if (!document.getElementById("description")) return false;
if (whichpic.getAttribute("title")) {
var text = whichpic.getAttribute("title");
} else {
var text = "";
}
var description = document.getElementById("description");
if (description.firstChild.nodeType==3) {
description.firstChild.nodeValue = text;
}
return false;

}*/

这两段代码明明一样 为什么效果却不同!我真的要跪了!!!