I\'m getting the following error
Uncaught TypeError: Cannot read property \'appendChild\' of null
myRequest.onreadystatechange @ script.js
those getting querySelector or getElementById that returns the following error:
Uncaught TypeError: Cannot read property 'appendChild' of null
or any other property, even if you have a class name or id in the HTML
don't use (defer as it is too much browser dependent.)
//don't use this
instead, put all your code in 'script.js' inside
$(document).ready(function(){
//your script here.
}