I\'m getting the following error
Uncaught TypeError: Cannot read property \'appendChild\' of null myRequest.onreadystatechange @ script.js
Uncaught TypeError: Cannot read property \'appendChild\' of null
myRequest.onreadystatechange @ script.js
Use querySelector insted of getElementById();
var c = document.querySelector('#mainContent'); c.appendChild(document.createElement('div'));