+ 5

JS error to fix ...

Hi, my JS code is working well in my browser but not here in the sololearn playground. Can someone explain me why, I would like to understand and fix it before adding content ... https://code.sololearn.com/W2ujCJvirUQy/?ref=app

25th Apr 2019, 1:29 PM
Jess
Jess - avatar
4 RĂ©ponses
+ 6
Lol ok I fixed it ... Thank you, I'm shameful it was so simple ... 😌
25th Apr 2019, 2:05 PM
Jess
Jess - avatar
25th Apr 2019, 8:42 PM
Jess
Jess - avatar
+ 2
its because the js code run before the page load. use onload listener on body to make sure the script run after the page loaded
25th Apr 2019, 1:43 PM
Taste
Taste - avatar
+ 2
Jess There is nothing shameful about it. The simplest things can be the easiest to miss. This is programming after all where a single missing symbol can cause an entire program to mess up or not run at all 😉
25th Apr 2019, 6:52 PM
Decimis † 𝕯𝖊𝖈𝖎𝖒𝖎𝖘
Decimis † 𝕯𝖊𝖈𝖎𝖒𝖎𝖘 - avatar