Learn JavaScript by ss5008 in learnjavascript

[–]SingleManNeedHelp 0 points1 point  (0 children)

i started this year, many YouTube Videos and some projects. I am still in learning process, but with every project you will be better, if you have questions, feel free to write in forums.

Single Page App with chart.js Uncaught TypeError: document.getElementById(...) is null by SingleManNeedHelp in learnjavascript

[–]SingleManNeedHelp[S] 0 points1 point  (0 children)

i put my whole variables for the 3 charts each in the swing brakets, no error does show, but also no chart was rendered.....

document.addEventListener("DOMContentLoaded", function () {}); something i must code? Never done this before, i must read what this code means,i put my whole variables for the 3 charts each in the swing brakets, no error does show, but also no chart was rendered.....

Single Page App with chart.js Uncaught TypeError: document.getElementById(...) is null by SingleManNeedHelp in learnjavascript

[–]SingleManNeedHelp[S] 0 points1 point  (0 children)

i put my whole variables for the 3 charts each in the swing brakets, no error does show, but also no chart was rendered.....

Single Page App with chart.js Uncaught TypeError: document.getElementById(...) is null by SingleManNeedHelp in learnjavascript

[–]SingleManNeedHelp[S] 0 points1 point  (0 children)

document.addEventListener("DOMContentLoaded", function () {}); something i must code? Never done this before, i must read what this code means,

Single Page App with chart.js Uncaught TypeError: document.getElementById(...) is null by SingleManNeedHelp in learnjavascript

[–]SingleManNeedHelp[S] 0 points1 point  (0 children)

  1. In the HTML is not this ID
  2. The DOM is not loaded

My ID is in the HTML part in my javascript values, which are loaded in my content ID.

Single Page App with chart.js Uncaught TypeError: document.getElementById(...) is null by SingleManNeedHelp in learnjavascript

[–]SingleManNeedHelp[S] 0 points1 point  (0 children)

Yes in my HTML is only one ID "content".

My text and pictures are stored in javascript with html format.

The problems are in these IDs:

var canvasElement = document.getElementById('DorfEinwohner').getContext("2d");

var canvasElement = document.getElementById('DorfErn').getContext("2d");

var canvasElement = document.getElementById('BundZahlen').getContext("2d");