Possible Duplicate:
javascript appendChild doesn't work
The error occurs on the last line of this snippet:
var anchor = "<a id=\"hostname\" href=\"" + destination + "\"> "+ imagename + "</a>";
var specialdiv = document.getElementById("specialdiv");
console.log("div: " + specialdiv);
specialdiv.appendChild(anchor);
There's really nothing else going on... I verified that specialdiv
isn't null or something like that. Can anyone explain why I'm getting this error on that line?