JavaScript AJAX Basics (retiring) Programming AJAX Processing JSON Data

"let statusHTML=" did not work

I tried with the let keyword, the widget didn't show up and it gave me this error: "Uncaught ReferenceError: statusHTML is not defined".
Then I used var, it works, but there's still an error: "Uncaught TypeError: Cannot set property 'innerHTML' of null" What am I missing?

2 Answers

Somehow it worked the next day, maybe VS Code needed a restart. Thanks for the answer!

Steven Parker
Steven Parker
172,046 Points

Viktor Rozgonyi — Glad to help, but normally you'd mark the answer that helped you as "best answer". :wink:

Steven Parker
Steven Parker
172,046 Points

The problem causing "Uncaught TypeError: Cannot set property 'innerHTML' of null" is that the code on left side of that assignment is not finding the element.

To be able to pin it down more specifically, we'd need to see the actual code, preferably in a workspace snapshot.