entire file code is wrapped inside
window.onload = function() {
// all code
}
Now I am appending child to div so when this file is executed I get typeerror cannot read property appendChild of null querySelector of null in browser console. How to avoid such issues?
some messages ago Simen said Try document.addEventListener("DOMContentLoaded", ...) instead of window.onload
oh ok let me check
no did not work
show codes
giving error https://pastebin.com/0X6KNHf5 at line 15 and 31
error in fakeMessage or insertMessssage ?
http://jsfiddle.net/jvillars/BZsvh/
So you are suggesting I should use document.getElementById().appendChild() instead of msgContainer.appendChild(domNode); ??
When debugging, always start with the first error. Sometimes it's the only one you need to fix.
I am suggesting put your script on top of the page wrapped in function and invoke at bottom of the pagge
Обсуждают сегодня