Can anyone explain what is theses errors?
Uncaught TypeError: Cannot set
property ‘innerHTML’ of nullUncaught TypeError: Cannot read
property ‘style’ of nullUncaught SyntaxError: Unexpected token
ILLEGALUncaught TypeError: Object #
has no method ‘dispatchEvent’
This is my test Website
At some point in the page you have:
The last line is causing the error because
elementis null. You should add a condition to the if(): that is, change this line:to this:
In other words, it’s a good practice to always check the return value of a function before accessing its properties.