以下时代吗
function showPic(whichpic){
var source = whichpic.getAttribute("href");
var place = document.getElementById("place");
place.setAttribute("src",source);
var text = whichpic.getAttribute("title");
var descripton = document.getElementById("descripton");
descripton.firstChild.nodeValue = text;
}
widow.onload = prepareGallery;
function prepareGallery(){
var gallery = document.getElementById("imagegallery");
var links = gallery.getElementsByTagName("a");
for (var i=0; i < links.length; i++) {
links[i].onclick = function (){
showPic(this);
return false;
}
}
}
报什么错啊?
请使用Google Chrome DevTools
window.onload
少了个n