var line = "<p><strong>" + name + ": </strong>" + message.field_message_body.und[0].value + "</p>";
console.log(line);
console.log(document.getElementById("messages"));
document.getElementById("messages").appendChild(line);
messages exists and it returns
<div id=messages"></div>
Nothing appears to be empty, so I'm not sure why this is being thrown.
Does anyone have any idea why it might be throwing this error?